Twitter user_timeline JSONP. No answer

solvable

The problem is that Twitter now (stupidly) requires OAuth even for public data. A relief is the local php script, which OAuths both receives data and accesses Ajax, and not directly to Ajaxing twitter.


I'm currently trying to pull custom timelines from twitter using the Reqwest JavaScript library. However, when I do this, the request is considered successful, but the data is not retrieved, and a GET error is displayed on the console. The im code is trying to look like this:

$.domReady(function () { $.ajax({ url: 'http://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitter', type: 'jsonp', success: function (response) { console.log(response); }, error: function (err) { console.log(err); } }); }) 
+1
source share
3 answers

I just updated the plugin to work with the Twitter API 1.1. Unfortunately, as per Twitter's requirement, you will need to fulfill the actual request from the server code. However, you can pass the response to the plugin and it will take care of the rest. I don’t know what environment you are working in, but I have already added sample code for the request in C # and I will soon add code for PHP.

0
source

Try passing the jsoncallback parameter. http://jsfiddle.net/CCTKa/

I got a Bad Authentication data error.

0
source

If we want, we can still parse their pages and redefine at least some of the lost functions with pure client JS.

We need: a CORS proxy server that can work with HTTPS pages (the only thing I know is the YQL API) and knowledge of how information is deleted on its public pages. With this in mind, we can get, for example, the last 20 tweets from the user, as it was in the demo: http://jsbin.com/agejol/1 (click "Edit in JSBin" to view the code)

PS I know that this may violate their policies, but I take care of it just as they cared for us when they dropped all of their client APIs.

0
source

Source: https://habr.com/ru/post/925684/


All Articles