Re: [twitter-dev] Re: Tweet(s) to XML or JSON

2011-03-07 Thread Matt Harris
Hi Mohorad,

Most of the Twitter APIs support multiple response formats. The most common
formats are XML and JSON but some methods also support RSS and ATOM.

The response format is controlled by changing the extension of the method.
For example:
http://search.twitter.com/search.json will return search results in JSON
format
http://search.twitter.com/search.atom will return search results in ATOM
format

The typical format of an API request is:
http://.twitter.com/.

Not all formats are supported so you should check the documentation on
dev.twitter.com to know if the format you are using is supported.

To know how the library you are using controls the response format you need
to refer to it's documentation or examples.

Best,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris


On Mon, Mar 7, 2011 at 4:17 AM, mahorad  wrote:

> Thanks for prompt reply but I had to mention that I'm using the Search
> API in a web service and at the first step I need to convert the
> retrieved tweets to JSON or XML.
> my tweet search is like this:
>
> Twitter twitter = new TwitterFactory().getInstance();
> try {
>Query q = new Query(args[0]);
>q.setRpp(100);
>q.setGeoCode(new GeoLocation(34.052, -118.2427778), 2500,
> Query.KILOMETERS);
>QueryResult result = twitter.search(q);
>List tweets = result.getTweets();
> } catch...
>
> regards
>
>
> On Mar 7, 1:05 pm, Scott Wilcox  wrote:
> > http://dev.twitter.com/doc/get/statuses/show/:id
> >
> > Sent from my iPhone
> >
> > On 7 Mar 2011, at 11:56, "mahorad"  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hello Gurus
> > > How can I get the XML or JSON format out of a Tweet or a bunch of
> > > Tweets?
> >
> > > --
> > > Twitter developer documentation and resources:
> http://dev.twitter.com/doc
> > > API updates via Twitter:http://twitter.com/twitterapi
> > > Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> > > Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: Tweet(s) to XML or JSON

2011-03-07 Thread mahorad
Thanks for prompt reply but I had to mention that I'm using the Search
API in a web service and at the first step I need to convert the
retrieved tweets to JSON or XML.
my tweet search is like this:

Twitter twitter = new TwitterFactory().getInstance();
try {
Query q = new Query(args[0]);
q.setRpp(100);
q.setGeoCode(new GeoLocation(34.052, -118.2427778), 2500,
Query.KILOMETERS);
QueryResult result = twitter.search(q);
List tweets = result.getTweets();
} catch...

regards


On Mar 7, 1:05 pm, Scott Wilcox  wrote:
> http://dev.twitter.com/doc/get/statuses/show/:id
>
> Sent from my iPhone
>
> On 7 Mar 2011, at 11:56, "mahorad"  wrote:
>
>
>
>
>
>
>
> > Hello Gurus
> > How can I get the XML or JSON format out of a Tweet or a bunch of
> > Tweets?
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this 
> > group:http://groups.google.com/group/twitter-development-talk

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk