public imgly(Twitter twitter, TwitterConfiguration twitterConfig) { this.tw = twitter; this.twitterConfig = twitterConfig; this.imglyApi = new ImglyApi(twitter.Api); }
public yfrog(Twitter twitter, TwitterConfiguration twitterConfig) { this.tw = twitter; this.twitterConfig = twitterConfig; this.yfrogApi = new YfrogApi(twitter.AccessToken, twitter.AccessTokenSecret); }
public TwitPic(Twitter twitter, TwitterConfiguration twitterConfig) { this.tw = twitter; this.twitterConfig = twitterConfig; this.twitpicApi = new TwitpicApi(twitter.AccessToken, twitter.AccessTokenSecret); }
protected void Page_Load(object sender, EventArgs e) { string userName = "******"; string password = "******"; DataSet ds = new DataSet(); Twitter twitter = new Twitter(); XmlDocument xmlDoc = twitter.GetUserTimelineAsXML(userName, password, "simonbegg", Twitter.OutputFormatType.XML); var query = (from c in xmlDoc.DocumentElement.ChildNodes.Cast<XmlNode>() select c.SelectSingleNode("text").InnerXml).Take(2); XmlTextReader xtr = new XmlTextReader(new StringReader(xmlDoc.OuterXml)); XElement xe = XElement.Load(xtr); string tweets = String.Empty; var foo = (from c in xe.Elements("status") select c.Element("text")).First(); foreach (string tweet in query) tweets += tweet + "<br />"; this.litTweet.Text = foo.ToString(); this.litTweetHeader.Text = "Latest tweets from talamh"; }
public imgly(Twitter twitter, TwitterConfiguration twitterConfig) { this.tw = twitter; this.twitterConfig = twitterConfig; this.imglyApi = new ImglyApi(twitter.AccessToken, twitter.AccessTokenSecret); }
public yfrog(Twitter twitter, TwitterConfiguration twitterConfig) { this.tw = twitter; this.twitterConfig = twitterConfig; this.yfrogApi = new YfrogApi(twitter.Api); }
public void templeHead(string URL,Twitter.API.TwitterUser user) { StartCoroutine(setAvatar(URL, null)); GameObject temp = GameObject.FindGameObjectWithTag("Base"); Debug.Log(temp.name); temp.GetComponent<temple>().thisUser = user; }
public Imgur(Twitter tw, TwitterConfiguration twitterConfig) { this.twitter = tw; this.twitterConfig = twitterConfig; this.imgurApi = new ImgurApi(); }
// Constructor public MainPage() { InitializeComponent(); Twitter = new Twitter(); App.TweetListVM = new TweetListViewModel(); this.DataContext = App.TweetListVM; App.TweetListVM.LoadData(); }
public Imgur(Twitter tw) { this._twitter = tw; Initialize(ApplicationSettings.TwitterConsumerKey, ApplicationSettings.TwitterConsumerSecret, tw.AccessToken, tw.AccessTokenSecret, "", ""); }
void CreateDirectServices() { // create direct services to social networks _twitter = new Twitter(); _sinaWeibo = new SinaWeibo(); //TODO: init facebook with your app ID and an array of permissions _facebook = new Facebook(); _facebook.Init("1234567890", new string[] {"read_stream", "email", "publish_stream"}); }
public TwipplePhoto(Twitter twitter) : base(new Uri("http://api.twitter.com/"), new Uri("https://api.twitter.com/1.1/account/verify_credentials.json")) { if (twitter == null) throw new ArgumentNullException("twitter"); _twitter = twitter; Initialize(ApplicationSettings.TwitterConsumerKey, ApplicationSettings.TwitterConsumerSecret, _twitter.AccessToken, _twitter.AccessTokenSecret, "", ""); }
static void Main(string[] args) { String ini; if (args.Length < 1) { Console.WriteLine("Please enter the name of the ini file"); ini = Console.ReadLine(); } else ini = args[0]; Console.WriteLine(ini); var twit = new Twitter(ini); //twit.testStream(); var testCount = 100; twit.populateData(testCount); while (twit.Data.Count() < testCount - 1) { Console.WriteLine(twit.Data.Count()); System.Threading.Thread.Sleep(5000); } twit.writeDateToFile(@"C:\Users\Kevin\Documents\TestJson\data.txt"); //twit.testStream("Disney"); Tweets data = new Tweets(); JsonSerializer serializer = new JsonSerializer(); serializer.NullValueHandling = NullValueHandling.Ignore; using (StreamReader sr = new StreamReader(@"C:\Users\Kevin\Documents\TestJson\data.txt")) using (JsonTextReader jr = new JsonTextReader(sr)) { if(!jr.Read() || jr.TokenType != JsonToken.StartArray) { throw new Exception("Expected start of array"); } while (jr.Read()) { if (jr.TokenType == JsonToken.EndArray) break; var item = serializer.Deserialize<TweetData>(jr); data.add(item); } } Console.WriteLine("done"); foreach (var tweet in data) { Console.WriteLine(tweet.text); } //twit.getData(); //while (twit.Data.Length <= 1) ; //Console.WriteLine(twit.Data+"\n"); //Twitter.testStream(ini); var news = new News(); news.getGoogleNews("Disney"); foreach (var article in news.Data) { Console.WriteLine(article.Title+" "+article.publishData.ToString() ); } Console.WriteLine("Done with everything"); Console.ReadLine(); }
public Filterize(Twitter.Status input, string query) { this.Input = input; this.Query = query; this.Filters = new Hashtable(); //this.Filters["text"] = new Filters.Text.Text(this.Input); //this.Filters["name"] = new Filters.Text.Name(this.Input); //this.Filters["screen_name"] = new Filters.Text.ScreenName(this.Input); //this.Filters["favorite_count"] = new Filters.Numerical.FavoriteCount(this.Input); }
public ActionResult Create([Bind(Include = "TileId,TileType,Title,SearchCriteria,RefreshPeriod")] Twitter twitter) { if (ModelState.IsValid) { twitter.TileType = 4; db.Tile.Add(twitter); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(twitter)); }
/// <summary> /// Defines the program entry point. /// </summary> /// <param name="args">An array of <see cref="T:System.String"/> containing command line parameters.</param> private static void Main(string[] args) { if (args.Length == 0) return; string userName = args[0]; Twitter twitter = new Twitter(); var messages = twitter.GetMessages(userName); foreach (var msg in messages) Console.WriteLine(msg.Text); }
/// <summary> /// コンストラクタ /// </summary> public MainWindow() { InitializeComponent(); // IcePlayer のウィンドウ移動(ドラッグ) を可能にする this.MouseLeftButtonDown += (sender, e) => this.DragMove(); _twitter = new Twitter(); _twitter.Initialize(); _twitter.Tweet(); }
public void LoginCompleteWithCompose(TwitterSession session) { Application.CaptureScreenshot("Screenshot.png"); UnityEngine.Debug.Log("Screenshot location=" + Application.persistentDataPath + "/Screenshot.png"); string imageUri = "file://" + Application.persistentDataPath + "/Screenshot.png"; Twitter.Compose(session, imageUri, "Welcome to", new string[] { "#TwitterKitUnity" }, (string tweetId) => { UnityEngine.Debug.Log("Tweet Success, tweetId=" + tweetId); }, (ApiError error) => { UnityEngine.Debug.Log("Tweet Failed " + error.message); }, () => { Debug.Log("Compose cancelled"); } ); }
public TwipplePhoto(Twitter twitter, TwitterConfiguration twitterConfig) { if (twitter == null) throw new ArgumentNullException("twitter"); if (twitterConfig == null) throw new ArgumentNullException("twitterConfig"); this.twitter = twitter; this.twitterConfig = twitterConfig; this.twippleApi = new TwippleApi(twitter.AccessToken, twitter.AccessTokenSecret); }
public TwipplePhoto(Twitter twitter, TwitterConfiguration twitterConfig) { if (twitter == null) throw new ArgumentNullException(nameof(twitter)); if (twitterConfig == null) throw new ArgumentNullException(nameof(twitterConfig)); this.twitter = twitter; this.twitterConfig = twitterConfig; this.twippleApi = new TwippleApi(twitter.Api); }
public FollowEventView(Contact source, Contact target, TwitterClient twitterClient, Twitter tw) { InitializeComponent(); Source = source; Target = target; DataContext = this; this.twitterClient = twitterClient; t = tw; _eventAggregator = CompositionManager.Get<IEventAggregator>(); }
public static async Task <Status> FavoritesDestroy( Twitter twitter, Int64 id) { var query = new Dictionary <string, string>(); query["id"] = id.ToString(); string res = await twitter.Request(API.Method.POST, new Uri(API.Urls.Favorites_Destroy), query); return(res != null ? new Status(res) : null); }
public Mobypicture(Twitter twitter, TwitterConfiguration twitterConfig) { if (twitter == null) throw new ArgumentNullException(nameof(twitter)); if (twitterConfig == null) throw new ArgumentNullException(nameof(twitterConfig)); this.twitter = twitter; this.twitterConfig = twitterConfig; this.mobypictureApi = new MobypictureApi(twitter.AccessToken, twitter.AccessTokenSecret); }
public void GetQuoteTweetStatusIds_OverflowTest() { var urls = new[] { // 符号付き 64 ビット整数の範囲を超える値 "https://twitter.com/kim_upsilon/status/9999999999999999999", }; var statusIds = Twitter.GetQuoteTweetStatusIds(urls); Assert.Empty(statusIds); }
/// <summary> /// handle external login if provider exist in Query String /// </summary> private void HandleExternalLogin() { var providerName = this.Get <HttpRequestBase>().QueryString.GetFirstOrDefaultAs <string>("auth"); var loginAuth = (AuthService)Enum.Parse(typeof(AuthService), providerName, true); var message = string.Empty; switch (loginAuth) { case AuthService.twitter: { var twitterAuth = new Twitter(); twitterAuth.LoginOrCreateUser(out message); } break; case AuthService.facebook: { var facebookAuth = new Facebook(); facebookAuth.LoginOrCreateUser(out message); } break; case AuthService.google: { var googleAuth = new Google(); googleAuth.LoginOrCreateUser(out message); } break; /* case AuthService.github: * { * var gitHubAccountAuth = new GitHub(); * gitHubAccountAuth.LoginOrCreateUser(out message); * } * * break;*/ } if (message.IsSet()) { this.PageContext.AddLoadMessage(message, MessageTypes.warning); } else { this.Get <IAspNetUsersHelper>().SignInExternal(); } }
public string contactSearchTwitter(string keyword) { List <Domain.Socioboard.Domain.DiscoverySearch> lstDiscoverySearch = new List <Domain.Socioboard.Domain.DiscoverySearch>(); string profileid = string.Empty; try { oAuthTwitter oauth = new oAuthTwitter(); Twitter obj = new Twitter(); TwitterAccountRepository twtAccRepo = new TwitterAccountRepository(); ArrayList alst = twtAccRepo.getAllTwitterAccounts(); foreach (Domain.Socioboard.Domain.TwitterAccount item in alst) { oauth.AccessToken = item.OAuthToken; oauth.AccessTokenSecret = item.OAuthSecret; oauth.TwitterUserId = item.TwitterUserId; oauth.TwitterScreenName = item.TwitterScreenName; obj.SetCofigDetailsForTwitter(oauth); if (this.CheckTwitterToken(oauth, keyword)) { break; } } Users twtUser = new Users(); JArray twitterSearchResult = twtUser.Get_Users_Search(oauth, keyword, "20"); foreach (var item in twitterSearchResult) { try { objDiscoverySearch = new Domain.Socioboard.Domain.DiscoverySearch(); objDiscoverySearch.FromId = item["screen_name"].ToString(); objDiscoverySearch.FromName = item["screen_name"].ToString(); objDiscoverySearch.SearchKeyword = keyword; lstDiscoverySearch.Add(objDiscoverySearch); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } return(new JavaScriptSerializer().Serialize(lstDiscoverySearch)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(new JavaScriptSerializer().Serialize("Please try Again")); } }
void TwitterSession() { TwitterSession twitterSession = Twitter.Session; if (twitterSession == null) { Twitter.LogIn(TwitterLoginComplete, TwitterLoginFailure); } else { TwitterLoginComplete(twitterSession); } }
public TwipplePhoto(Twitter twitter) : base(new Uri("http://api.twitter.com/"), new Uri("https://api.twitter.com/1.1/account/verify_credentials.json")) { if (twitter == null) { throw new ArgumentNullException("twitter"); } _twitter = twitter; Initialize(ApplicationSettings.TwitterConsumerKey, ApplicationSettings.TwitterConsumerSecret, _twitter.AccessToken, _twitter.AccessTokenSecret, "", ""); }
public static async Task <List> ListsDestroy( Twitter twitter, Int64?list_id = null, string slug = null, Int64?owner_id = null, string owner_screen_name = null) { var query = new Dictionary <string, string>(); query["list_id"] = list_id.ToString(); query["slug"] = slug; query["owner_id"] = owner_id.ToString(); query["owner_screen_name"] = owner_screen_name; return(new List( await twitter.Request(API.Method.POST, new Uri(API.Urls.Lists_Destroy), query))); }
public void ThrowArgumentEx_When_UserId_IsEmptyString() { var unitMock = new Mock <IUnitOfWork>(); var twitterRepoMock = new Mock <ITwitterRepository>(); var twitterService = new TwitterService(unitMock.Object, twitterRepoMock.Object); string userId = String.Empty; var twitter = new Twitter { Id = "1284738912734897" }; Assert.Throws <ArgumentException>(() => twitterService.SaveTwitterByUserId(userId, twitter)); }
void Window1_Loaded(object sender, RoutedEventArgs e) { Yedda.Twitter twit = new Twitter(); var resultString = twit.GetUserTimeline("*****@*****.**", "You Cant Have My Password!", Twitter.OutputFormatType.JSON); var str = new StringReader(resultString); var converter = new JsonSerializer(); converter.MissingMemberHandling = MissingMemberHandling.Ignore; var obj = (List <TwitObj>)converter.Deserialize(str, typeof(List <TwitObj>)); TwitterListView.ItemsSource = obj; }
void StartComponseTweet(TwitterSession session, string imageUri) { // this.Score = score_manager.GetCurrentScore(); Twitter.Compose(session, imageUri, string.Format(Description, ScoreZeros(Score, 5)), new string[] { "#tetris #puzzle #brick" }, (string tweetId) => { UnityEngine.Debug.Log("Tweet Success, tweetId = " + tweetId); }, (ApiError error) => { UnityEngine.Debug.Log("Tweet Failed " + error.message); }, () => { Debug.Log("Compose cancelled"); } ); }
public void startRequestEmail() { TwitterSession session = Twitter.Session; if (session != null) { Twitter.RequestEmail(session, requestEmailComplete, requestEmailFailure); } else { startLogin(); } }
public IActionResult Index(string tag) { Twitter t = new Twitter(); var listPost = t.returnPostTwitter(tag); foreach (var post in listPost) { _postService.Add(post); } return(View(listPost)); }
public static async Task <Status> StatusesUpdate( Twitter twitter, string status, Int64?in_reply_to_status_id = null) { var query = new Dictionary <string, string>(); query["status"] = status; query["in_reply_to_status_id"] = in_reply_to_status_id.ToString(); return(new Status( await twitter.Request(API.Method.POST, new Uri(API.Urls.Statuses_Update), query))); }
public void StartLogin() { var session = Twitter.Session; if (session == null) { Twitter.LogIn(LoginComplete, LoginFailure); } else { LoginComplete(session); } }
public void TwitterObjectHasAttributes() { var twitter = new Twitter(); var titleProperty = twitter.GetType().GetProperty("Title"); var linkProperty = twitter.GetType().GetProperty("Link"); var descriptionProperty = twitter.GetType().GetProperty("Description"); var tweets = twitter.GetType().GetProperty("Tweets"); Assert.IsNotNull(titleProperty, "Title Property Missing"); Assert.IsNotNull(linkProperty, "Link property missing"); Assert.IsNotNull(descriptionProperty, "Description property missing"); Assert.IsNotNull(tweets, "tweets property missing"); }
public void GetQuoteTweetStatusIds_QuotedStatusLinkTest() { var entities = new TwitterEntities(); var quotedStatusLink = new TwitterQuotedStatusPermalink { Url = "https://t.co/3HXq0LrbJb", Expanded = "https://twitter.com/kim_upsilon/status/599261132361072640", }; var statusIds = Twitter.GetQuoteTweetStatusIds(entities, quotedStatusLink); Assert.Equal(new[] { 599261132361072640L }, statusIds); }
public static async Task <User> MutesUsersDestroy( Twitter twitter, string screen_name = null, Int64?id = null) { var query = new Dictionary <string, string>(); query["screen_name"] = screen_name; query["user_id"] = id.ToString(); return(new User( await twitter.Request( API.Method.POST, new Uri(API.Urls.Mutes_Users_Destroy), query))); }
public Twitter buscarUsuario(string screenName) { ConexionSqlServer conexion = new ConexionSqlServer(); SqlDataReader tabla = conexion.consultar("select * from Twitter where ScreenName= '" + screenName + "';"); Twitter twitter = new Twitter(); while (tabla != null && tabla.Read()) { twitter = new Twitter(tabla["IDUSUARIO"].ToString(), tabla["SCREENNAME"].ToString(), tabla["OauthToken"].ToString(), tabla["OauthTokenSecret"].ToString()); } conexion.cerrarConexion(); return(twitter); }
static void Main(string[] args) { List<string> terms = new List<string>(); var options = new Options(); var result = CommandLine.Parser.Default.ParseArguments(args, options); var twit = new Twitter(options.ini); Console.WriteLine("Connected to twitter"); var news = new News(); string date = DateTime.Now.ToString("M-d-yyyy"); if (!Directory.Exists(options.twitterStore + date)) { Directory.CreateDirectory(options.twitterStore + date); } if (!Directory.Exists(options.newsStore + date)) { Directory.CreateDirectory(options.newsStore + date); } //TODO do the same for the news articles string time = DateTime.Now.ToString("HHmmss"); foreach (var x in options.terms) { string path = options.twitterStore +date; string fileName = time+"-"+x+".txt"; string file = Path.Combine(path, fileName); twit.populateData(x, options.tweetCount); while (twit.Data.Count() < options.tweetCount - 1) { System.Threading.Thread.Sleep(5000); Console.WriteLine("Topic:"+x +" count="+twit.Data.Count()); } Console.WriteLine("Collection for " + x + " done, writing to file."); twit.writeDateToFile(file); Console.WriteLine("Writing file done"); } Console.WriteLine("collecting generic data"); twit.populateData(1000); while (twit.Data.Count() < 1000 - 1) { System.Threading.Thread.Sleep(5000); Console.WriteLine("Count=" + twit.Data.Count()); } twit.writeDateToFile(Path.Combine(options.twitterStore+date, time+".txt")); foreach (var x in options.terms) { string path = options.newsStore + date; string fileName = time + "-" + x + ".txt"; string file = Path.Combine(path, fileName); news.getGoogleNews(x); news.writeDateToFile(file); } Console.WriteLine("Collection Done"); Console.ReadLine(); }
public ActionResult GetTwittes(string searchText = "Istanbul") { try { if (Session["SearchText"] == null) { InitSessions(); } string lastSearchText = Session["SearchText"].ToString(); if (Session["NextResults"] == null) { Session["NextResults"] = ""; if (lastSearchText.Trim() == searchText.Trim()) { var emptyData = new { Result = "", Success = false, NewPage = false }; return(Json(emptyData)); } } string consumerKey = ConfigurationManager.AppSettings["oAuthConsumerKey"]; string consumerSecret = ConfigurationManager.AppSettings["oAuthConsumerSecret"]; string nextResults = Session["NextResults"].ToString(); nextResults = ((lastSearchText.Trim() == searchText.Trim()) ? nextResults : ""); Twitter twitter = new Twitter(consumerKey, consumerSecret); TwitteSearchResult result = twitter.TextSearch(searchText, nextResults); result = TwitteSearchResult.FormatModel(result);//Foramt the model. var newPage = searchText.Trim() == lastSearchText.Trim(); Session["NextResults"] = result.SearchMetadata.NextResults; Session["SearchText"] = searchText; var jsonData = new { Result = result, Success = true, NewPage = newPage }; return(Json(jsonData)); } catch (Exception ex) { return(Json(new { Result = ex.StackTrace, Success = false, NewData = false })); } }
public TwitterViewModel() { string consumerKey = ConfigurationManager.AppSettings["ConsumerKey"].ToString(); string consumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"].ToString(); string token = ConfigurationManager.AppSettings["Token"].ToString(); string tokenSecret = ConfigurationManager.AppSettings["TokenSecret"].ToString(); _twitter = new TwitterLib.Twitter(consumerKey, consumerSecret, token, tokenSecret); _twitter.GotHomeTimeline += new Twitter.HomeTimelineEventHandler(GotHomeTimeline); _twitter.GotFavorites += new Twitter.FavoritesEventHandler(GotFavorites); loadLogos(); }
public static async Task <string> OauthAccessToken( Twitter twitter, string xAuthUsername, string xAuthPassword) { var query = new Dictionary <string, string>(); query["x_auth_username"] = xAuthUsername; query["x_auth_password"] = xAuthPassword; query["x_auth_mode"] = "client_auth"; return(await twitter.Request(API.Method.POST, new Uri(API.Urls.Oauth_AccessToken), query)); }
public void LoginCompleteWithCompose(TwitterSession session) { UnityEngine.Debug.Log("Screenshot location=" + FilePath); string imageUri = "file://" + FilePath; Twitter.Compose( session, imageUri, "Welcome to", new string[] { "#TwitterKitUnity" }, (string tweetId) => { UnityEngine.Debug.Log("Tweet Success, tweetId=" + tweetId); _fileManager.DeleteFile(FilePath); }, (ApiError error) => { UnityEngine.Debug.Log("Tweet Failed " + error.message); _fileManager.DeleteFile(FilePath); }, () => { UnityEngine.Debug.Log("Compose cancelled"); _fileManager.DeleteFile(FilePath); } ); }
private async IAsyncEnumerable <IPost> TestFindPosts(PostsSearchQuery postsSearchQuery) { InitializePostQuery(postsSearchQuery); IAsyncEnumerable <IPost> posts = Twitter.FindPostsAsync(postsSearchQuery); await CheckAnyPosts(posts); await CheckPosts(postsSearchQuery, posts); await foreach (IPost post in posts) { yield return(post); } }
public void SearchWithInvalidArgs_ThrowsArgumentException() { ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search(null), "searchQuery"); ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => Twitter.Search("any term", width: -1)); ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => Twitter.Search("any term", height: -1)); ExceptionAssert.Throws <ArgumentOutOfRangeException>(() => Twitter.Search("any term", searchInterval: 0)); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", backgroundShellColor: null), "backgroundShellColor"); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", shellColor: null), "shellColor"); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", tweetsBackgroundColor: null), "tweetsBackgroundColor"); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", tweetsColor: null), "tweetsColor"); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", tweetsLinksColor: null), "tweetsLinksColor"); ExceptionAssert.ThrowsArgNullOrEmpty(() => Twitter.Search("any term", behavior: null), "behavior"); }
public void UpdateLikesCount() { var articles = new FeedService().GetArticlesWithoutBody(32997); foreach (var a in articles) { a.LikesCount = Facebook.GetNumberOfLikes(a.Url) + Twitter.GetNumberOfTweets(a.Url) + LinkedIn.GetNumberOfShares(a.Url) + Google.GetNumberOfShares(a.Url) + Reddit.GetNumberOfVotes(a.Url); new FeedService().UpdateArticle(a); } }
private void CreateServices(Twitter tw, TwitterConfiguration twitterConfig) { this.pictureService?.Clear(); this.pictureService = null; this.pictureService = new Dictionary <string, IMediaUploadService> { ["Twitter"] = new TwitterPhoto(tw, twitterConfig), ["img.ly"] = new imgly(tw, twitterConfig), ["yfrog"] = new yfrog(tw, twitterConfig), ["ついっぷるフォト"] = new TwipplePhoto(tw, twitterConfig), ["Imgur"] = new Imgur(tw, twitterConfig), ["Mobypicture"] = new Mobypicture(tw, twitterConfig), }; }
// GET: Twitters/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Twitter twitter = db.Twitters.Find(id); if (twitter == null) { return(HttpNotFound()); } return(View(twitter)); }
private ErrorCode ErrorHandlerTwitter(ErrorCode errorCode = ErrorCode.NP_ERR_FAILED) { if (errorCode != 0) { ResultCode result = default(ResultCode); Twitter.GetLastError(out result); if (result.lastError != 0) { OnScreenLog.Add("Error: " + result.className + ": " + result.lastError + ", sce error 0x" + result.lastErrorSCE.ToString("X8")); return(result.lastError); } } return(errorCode); }
public void MakeZombie(Twitter.API.TwitterUser user) { //Make a new zombie //with properties n shit GameObject newGuy = Instantiate(Resources.Load("zombiething")) as GameObject; newGuy.GetComponent<Actor>().thisUser = user; StartCoroutine(setAvatar(user.avatarURL, newGuy.GetComponent<Actor>())); newGuy.name = user.displayName; if (IDs.Count < 100) newGuy.GetComponent<Actor>().offset = babs.Count * (360f / (float)IDs.Count); else newGuy.GetComponent<Actor>().offset = babs.Count * (360f / 100f); babs.Add(newGuy); }
public override async Task RefreshAsync(Twitter tw, bool _, bool startup, IProgress<string> progress) { bool read; if (!SettingCommon.Instance.UnreadManage) read = true; else read = startup && SettingCommon.Instance.Read; progress.Report("Related refreshing..."); await tw.GetRelatedResult(read, this) .ConfigureAwait(false); TabInformations.GetInstance().DistributePosts(); progress.Report("Related refreshed"); }
public override async Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress) { bool read; if (!SettingCommon.Instance.UnreadManage) read = true; else read = startup && SettingCommon.Instance.Read; progress.Report(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText19); await tw.GetFavoritesApi(read, backward) .ConfigureAwait(false); TabInformations.GetInstance().DistributePosts(); progress.Report(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText20); }
public override async Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress) { bool read; if (!SettingCommon.Instance.UnreadManage) read = true; else read = startup && SettingCommon.Instance.Read; progress.Report(string.Format(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText8, backward ? -1 : 1)); await tw.GetDirectMessageApi(read, MyCommon.WORKERTYPE.DirectMessegeRcv, backward) .ConfigureAwait(false); await tw.GetDirectMessageApi(read, MyCommon.WORKERTYPE.DirectMessegeSnt, backward) .ConfigureAwait(false); TabInformations.GetInstance().DistributePosts(); progress.Report(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText11); }
void CreateDirectServices() { // create direct services to social networks _twitter = new Twitter(); _twitter.InitializationCompleted += OnDirectServiceInit; _twitter.InitializationFailed += OnDirectServiceInitFailed; _twitter.Init(); _sinaWeibo = new SinaWeibo(); _sinaWeibo.InitializationCompleted += OnDirectServiceInit; _sinaWeibo.InitializationFailed += OnDirectServiceInitFailed; _sinaWeibo.Init(); // init facebook with your app ID and an array of permissions _facebook = new Facebook(); _facebook.InitializationCompleted += OnDirectServiceInit; _facebook.InitializationFailed += OnDirectServiceInitFailed; _facebook.Init(facebookAppID, new string[] {"read_stream", "email", "publish_stream"}); }
public static Task<ServiceResponse<TwitterAuthResponse>> Login( Twitter twitterInfo, string applicationId, string apiKey, IRestClient restClient) { var request = new TwitterAuthRequest () { authData = new AuthData () { twitter = twitterInfo } }; restClient.AddHeader ("X-Parse-Application-Id", applicationId); restClient.AddHeader ("X-Parse-REST-API-Key", apiKey); return restClient.PostAsync<TwitterAuthResponse>("https://api.parse.com/1/users", request, Format.Json); }
/// <summary> /// 与えられたステータスをクエリに基づいて検証します。 /// </summary> /// <param name="status"></param> /// <returns>検証結果</returns> public bool Match(Twitter.Status status) { bool result = this.IsNegate; LogicalOperator? opr = null; switch (this.Filters.Count) { case 0: return !this.IsNegate; case 1: if (!this.IsNegate) return this.Filters[0].Match(status); else return !this.Filters[0].Match(status); default: foreach (IFilterObject f in this.Filters) { bool _result = f.Match(status); switch (opr) { case LogicalOperator.And: // and result &= _result; break; case LogicalOperator.Or: // or result |= _result; break; case LogicalOperator.Xor: // xor result ^= _result; break; default: result = _result; break; } opr = f.Operator; } return result; } }
public override async Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress) { if (this.ListInfo == null || this.ListInfo.Id == 0) return; bool read; if (!SettingCommon.Instance.UnreadManage) read = true; else read = startup && SettingCommon.Instance.Read; progress.Report("List refreshing..."); await tw.GetListStatus(read, this, backward, startup) .ConfigureAwait(false); TabInformations.GetInstance().DistributePosts(); progress.Report("List refreshed"); }
/// <summary> /// UpdateLimitNotificationクラスを初期化します。 /// </summary> /// <param name="twitter">Twitterクラス</param> /// <param name="notifyCount">規制通知を行うポスト数</param> /// <param name="notificationMassage">通知メッセージ</param> /// <param name="limitReleaseDateFormat">規制解除時刻フォーマット</param> /// <param name="notAccuracyMessage">不正確時に付加されるメッセージ</param> public UpdateLimitNotification( Twitter twitter, int notifyCount, string notificationMassage, string limitReleaseDateFormat, string notAccuracyMessage) { Twitter = twitter; NotifyCount = notifyCount; NotificationMessage = notificationMassage; LimitReleaseDateFormat = limitReleaseDateFormat; NotAccuracyMessage = notAccuracyMessage; SyncObj = new object(); TabInformations.GetInstance().AddPostCalled += new EventHandler<Event.PostClassEventArgs>(UpdateLimitNotification_AddPostCalled); twitter.ChangedUserName += new EventHandler<EventArgs>(twitter_ChangedUserName); }