Managing Tweepy API Search

I originally worked out a solution based on Yuva Raj’s suggestion to use additional parameters in GET search/tweets – the max_id parameter in conjunction with the id of the last tweet returned in each iteration of a loop that also checks for the occurrence of a TweepError. However, I discovered there is a far simpler … Read more

Getting started with Twitter\OAuth2\Python

Almost all oauth examples on blogs seem to be examples of the authorisation phase of oauth and none focus on how to actually make requests once you have these, as once you understand how it works this part is quite obvious. Getting that initial understanding is quite difficult unfortunately. If you’re just trying access your … Read more

Twitter API – Reasons for “invalid or expired token”

Check the integrity of an access token at any time by calling the GET account/verify_credentials while using that access token. Its mentioned and by research I came to know that: Your access token will be invalid if a user explicitly rejects your application from their settings or if a Twitter admin suspends your application. If … Read more

UIActivityViewController completion handler returns success when tweet has failed

Use completion handler like this For SWIFT 3 AND 4, iOS 10 AND 11 : activityVC.completionWithItemsHandler = {(activityType: UIActivityType?, completed: Bool, returnedItems: [Any]?, error: Error?) in if !completed { // User canceled return } // User completed activity } self.present(activityVC, animated: true, completion: nil)

Why this error ‘ – Read-only application cannot POST ‘

Login in your app: http://dev.twitter.com/apps In the Settings tab, change the Application type to Read, Write and Access direct messages In the Reset keys tab, press the Reset button, update the consumer key and secret in your application accordingly. It looks like that resetting the keys force the change to your application type to take … Read more

How to force WebRequest to send Authorization header during POST

Here’s my solution. The value is in variable json. var myUri = new Uri(fullpath); var myWebRequest = WebRequest.Create(myUri); var myHttpWebRequest = (HttpWebRequest)myWebRequest; myHttpWebRequest.PreAuthenticate = true; myHttpWebRequest.Headers.Add(“Authorization”, “Bearer ” + AccessToken); myHttpWebRequest.Accept = “application/json”; var myWebResponse = myWebRequest.GetResponse(); var responseStream = myWebResponse.GetResponseStream(); if (responseStream == null) return null; var myStreamReader = new StreamReader(responseStream, Encoding.Default); var json … Read more

Is there a way to get the twitter share count for a specific URL?

You can use the following API endpoint, http://cdn.api.twitter.com/1/urls/count.json?url=http://stackoverflow.com Note that the http://urls.api.twitter.com/ endpoint is not public.) The endpoint will return a JSON string similar to, {“count”:27438,”url”:”http:\/\/stackoverflow.com\/”} On the client, if you are making a request to get the URL share count for your own domain (the one the script is running from), then an AJAX … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)