本文整理汇总了C#中BaseLib.clsDBQueryManager.InsertDataRetweet方法的典型用法代码示例。如果您正苦于以下问题:C# clsDBQueryManager.InsertDataRetweet方法的具体用法?C# clsDBQueryManager.InsertDataRetweet怎么用?C# clsDBQueryManager.InsertDataRetweet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLib.clsDBQueryManager
的用法示例。
在下文中一共展示了clsDBQueryManager.InsertDataRetweet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetweetDataExtractor
public void RetweetDataExtractor()
{
try
{
if (!string.IsNullOrEmpty(txtRetweetCount.Text) && NumberHelper.ValidateNumber(txtRetweetCount.Text))
{
RetweetExtractCount = Convert.ToInt32(txtRetweetCount.Text);
TwitterDataScrapper.RetweetExtractcount = RetweetExtractCount;
}
else
{
AddToTweetCreatorLogs("Entered Count incorrect.Setting Default Count 10");
}
TwitterDataScrapper DataScraper = new TwitterDataScrapper();
foreach (string item in lstUserId_Retweet)
{
AddToTweetCreatorLogs("Extracting ReTweets For " + item);
List<string> TweetData = DataScraper.GetRetweetData_Scrape(item);
AddToTweetCreatorLogs(TweetData.Count + " Retweet From User : " + item);
if (TweetData.Count > 0)
{
new Thread(() =>
{
foreach (string newItem in TweetData)
{
string[] arry = Regex.Split(newItem, ":");
if (arry.Length == 3)
{
AddToTweetCreatorLogs("---------------------------------------------------------");
AddToTweetCreatorLogs(arry[0] + " : " + arry[1]);
AddToTweetCreatorLogs(arry[2]);
clsDBQueryManager DataBase = new clsDBQueryManager();
DataBase.InsertDataRetweet(arry[0], arry[1], arry[2]);
}
else
{
}
}
}).Start();
}
else
{
AddToTweetCreatorLogs("Sorry No ReTweets For " + item);
}
}
AddToTweetCreatorLogs("Finished Extracting ReTweets");
AddToTweetCreatorLogs("ReTweets Stored In -" + Globals.Path_RETweetExtractor);
if (txtRetweetSingle.InvokeRequired)
{
txtRetweetSingle.Invoke(new MethodInvoker(delegate
{
txtRetweetSingle.Text = "";
}));
}
if (txtRetweetFile.InvokeRequired)
{
txtRetweetFile.Invoke(new MethodInvoker(delegate
{
txtRetweetFile.Text = "";
}));
}
}
catch (Exception ex)
{
Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> RetweetDataExtractor() --> " + ex.Message, Globals.Path_TweetCreatorErroLog);
Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine("Error --> RetweetDataExtractor() --> " + ex.Message, Globals.Path_TwtErrorLogs);
}
}
示例2: RetweetDataExtractor
public void RetweetDataExtractor()
{
try
{
if (!string.IsNullOrEmpty(txtRetweetCount.Text) && NumberHelper.ValidateNumber(txtRetweetCount.Text))
{
RetweetExtractCount = Convert.ToInt32(txtRetweetCount.Text);
TwitterDataScrapper.RetweetExtractcount = RetweetExtractCount;
}
else
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Entered Count incorrect.Setting Default Count 10 ]");
}
TwitterDataScrapper DataScraper = new TwitterDataScrapper();
foreach (string item in lstUserId_Retweet)
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Extracting ReTweets For " + item + " ]");
string ReturnStatus = string.Empty;
List<string> TweetData = DataScraper.GetRetweetData_Scrape(item, out ReturnStatus);
if (ReturnStatus.Contains("No Error"))
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + TweetData.Count + " Retweet From User : " + item + " ]");
if (TweetData.Count > 0)
{
//new Thread(() =>
//{
foreach (string newItem in TweetData)
{
string[] arry = Regex.Split(newItem, ":");
if (arry.Length == 3)
{
//AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + arry[0] + " : " + arry[1] + " ]");
//AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + arry[2] + " ]");
clsDBQueryManager DataBase = new clsDBQueryManager();
DataBase.InsertDataRetweet(arry[0], arry[1], arry[2]);
}
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + newItem + " ]");
}
//}).Start();
}
else
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Sorry No ReTweets For " + item + " ]");
}
}
else if (ReturnStatus.Contains("Rate limit exceeded"))
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Rate limit exceeded ]");
break;
}
else if (ReturnStatus.Contains("Sorry, that page does not exist"))
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + item + " >>> Sorry, that page does not exist ]");
}
else if (ReturnStatus.Contains("Empty"))
{
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + item + " >>>> Return Empty ]");
}
else
{
//AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ " + item + " >>> Errror in Request ]");
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ No item Found From User " + item + " ]");
}
}
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ ReTweets Stored In -" + Globals.Path_RETweetExtractor + " ]");
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Finished Extracting ReTweets ]");
AddToTweetCreatorLogs("-----------------------------------------------------------------------------------------------------------------------");
if (txtRetweetFile.InvokeRequired)
{
txtRetweetFile.Invoke(new MethodInvoker(delegate
{
txtRetweetFile.Text = "";
}));
}
}
catch (Exception ex)
{
Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> RetweetDataExtractor() --> " + ex.Message, Globals.Path_TweetCreatorErroLog);
Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine("Error --> RetweetDataExtractor() --> " + ex.Message, Globals.Path_TwtErrorLogs);
}
}