Twitter Stream no longer loading?


#1

I’m trying to catchup with this API change thing. I have a pretty basic script that searches and streams tweets live. It’s been working great for the past two years, but yesterday, stopped functioning. I have read the documentation and found I needed to change http://search.twitter.com/search.json?q= to https://api.twitter.com/1.1/search/tweets.json?q=

But that’s not working for me either. I guess there’s a few more changes I need to make, or maybe that new API isn’t working right judging from some posts I’ve read. Anyone know what’s up???

I have posted the JS to pastebin. You assistance is greatly appreciated.

http://pastebin.com/SLkTXBpb


#2

The problem affecting search yesterday applied to both versions of the API and wasn’t related to the upcoming retirement of API v1.1. You still should move to API v1.1 though, which isn’t well suited to pure client-side Javascript use cases.


#3

Thank you for your response @episod. Everything is working again today! Hooray.

Still confused about these changes though and what needs to change in my code.

From what I gather:

	apifMultipleUSER = "http://search.twitter.com/search.json?from%3A";
	apifUSER = "http://search.twitter.com/search.json?q=from%3A";
	apitMultipleUSER = "http://search.twitter.com/search.json?to%3A";
	apitUSER = "http://search.twitter.com/search.json?q=to%3A";
	apiSEARCH = "http://search.twitter.com/search.json?q=";

Needs to changes to:

            apifMultipleUSER = "https://api.twitter.com/1.1/search/tweets.json?from%3A";
            apifUSER = "https://api.twitter.com/1.1/search/tweets.json?q=from%3A";
            apitMultipleUSER = "https://api.twitter.com/1.1/search/tweets.json?to%3A";
            apitUSER = "https://api.twitter.com/1.1/search/tweets.json?q=to%3A";
            apiSEARCH = "https://api.twitter.com/1.1/search/tweets.json?q=";

Is that correct?

What’s this about JS no longer work with the new API?


#4

And it’s down again… so frustrating. What do I have to do to fix this?


#5

The Twitter API 1.1 requires Authentication, public JavasScript (or jQuery JSONP) requests are not allowed anymore. You can create your own serverside solution as @user1760396 suggested.

I had the same problem and created a public service that can form a bridge between your app and the Twitter API. Create your access token at: http://livetweets.johandorper.com and you can use the jQuery JSONP code again.