Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. var tokens = Configuration.GetTokens(Twitter.oSelf.username, DefaultConfig);
  2.                 TwitterResponse<TwitterSearchResultCollection> res = null;
  3.                 var total =  0;
  4.                 do
  5.                 {
  6.                     res = TwitterSearch.Search(tokens,
  7.                         Common.DelHttp(Link.OriginalString),
  8.                         new SearchOptions()
  9.                         { UseSSL = true,
  10.                             Count = 100,
  11.                             IncludeEntities = false,
  12.                             MaxId = res?.ResponseObject.Last().Id ??  0}
  13.                         );
  14.                     if (res.Result == RequestResult.Success)
  15.                     {
  16.                         total += res.ResponseObject.Count;
  17.                     }
  18.                 } while (res.Result == RequestResult.Success && res.ResponseObject.Count == 100 && total < 1000);//ограничиваемся 1000, иначе много запросов
  19.                 //все прошло на ура, иначе не будем добавлять даже 0
  20.                 if (res.Result == RequestResult.Success)
  21.                 {
  22.                     oRet.Add("count", total);
  23.                 }




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018