Problem using Twitter Json API in LiveCode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
IsDark
Posts: 6
Joined: Thu Apr 21, 2011 9:06 pm

Problem using Twitter Json API in LiveCode

Post by IsDark » Sat Sep 10, 2011 4:56 pm

I'm strugling with a little problem fetching data from Twitter API.

When I called from firefox browser the below url it works (returning a JSON file):

Code: Select all

http://search.twitter.com/search.json?rpp=100&result_type=recent&page=1&q=love
When I try to fetch the data using LiveCode,

Code: Select all

      put ("http://search.twitter.com/search.json?rpp=100&result_type=recent&page=1&q=" & URLEncode("love")) into TwitterSearch
      put URL TwitterSearch into Logs
it returns
The request url was not found in the server
RAD Delphi XE can get the data, but LiveCode not.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Problem using Twitter Json API in LiveCode

Post by sturgis » Sat Sep 10, 2011 5:48 pm

Hmm. It works for me as written.. well except I just dump the contents to a field.

This works as expected.

Code: Select all

on mouseUp
   put ("http://search.twitter.com/search.json?rpp=100&result_type=recent&page=1&q=" & URLEncode("love")) into TwitterSearch
   put TwitterSearch -- Maybe check to see if you have a typo, or problem with the url?
   put URL TwitterSearch into field "outField"
end mouseUp

Post Reply