Search twitter with appcelerator
Im following the twitter example in the kitchen sink. I am trying to utilize the twitter search api.
Eg of a url will be
http://search.twitter.com/search.json?rpp=30&q=#marketing
If I want to search more than 1 term, the following is the url
http://search.twitter.com/search.json?rpp=30&q=#IR+OR+#PR+OR+#Advertising+OR+#Marketing
The first url works in xhr but the second wont. As the '+' get encoded t0 %2B.
Is there anyway to stop this?
4 Answers
-
Hasnt anyone tried the twitter search api in appcelerator.
-
take a look at
Titanium.Network.decodeURIComponent
and
Titanium.Network.encodeURIComponent
hard to provide much more guidance without any code being posted. this is a link that explains it all
-
I think the URI component is the problem. Its encoding my # and +. Heres my code
var xhr = Ti.Network.createHTTPClient(); xhr.timeout = 1000000; xhr.open("GET","http://search.twitter.com/search.json?rpp=30&q=#IR+OR+#PR+OR+#Advertising+OR+#Marketing"); xhr.send();
If the '+' and '#' gets encoded there wont be any results. If you put the url directly to your browser u can see the results.
-
I think the URI component is the problem. Its encoding my # and +. Heres my code
var xhr = Ti.Network.createHTTPClient(); xhr.timeout = 1000000; xhr.open("GET","http://search.twitter.com/search.json?rpp=30&q=#IR+OR+#PR+OR+#Advertising+OR+#Marketing"); xhr.send();
If the '+' and '#' gets encoded there wont be any results. If you put the url directly to your browser u can see the results.