[twitter-dev] Hi joining to this forum.

2010-12-06 Thread Zia
Hi guys

I am attaching twitter in my web site. So I will come time to time to
this forum  whenever I will need.

Thanks
ziaur

-- 
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


Re: [twitter-dev] xAuth Request gives Error from samsung tv maple browser

2010-12-06 Thread umamahesh G.
HI Tom,

Thanks for your support. I am using javascript for samsung TV Applicaiton
not for normal browser so there is no way to know about keys and secret
key.Actually Samsung SDK uses Maple browser and  application runs on  this
browser.

I hope you help me out from this issue.

Please find the below code.




html
head
lt;script type =text/Javascript language=Javascript
src=sha1.js/script
lt;script type=text/javascript charset=utf-8

/*To authorize on Twitter API through xAuth, you need HMAC-SHA1
I'm using the following lib for that:
http://jssha.sourceforge.net
Make sure you have sha.js included!Also, you need to email
a...@twitter.comto get xAuth access
I cannot do that for you - see http://dev.twitter.com/pages/xauth
cross-domain XHRs only work on file:// protocol pages
use PhoneGap!
 */

var TwitterApiRequest = function() {
this.nonce = this.generateNonce();
this.timestamp = this.getUTCtimestamp();

this.postBody = null;
this.signature = null;
this.signatureBaseString = null;
this.consumerSecret=MY consumerSecret ;
}

TwitterApiRequest.prototype.generateNonce = function () {
var nonce = [];
var length = 6; // arbitrary - looks like a good length

for (length; length  0; length--)
nonce.push1+Math.random())*0x1)|0).toString(16).substring(1));

return nonce.join();
}

// could possibly do without UTC, but here we are
TwitterApiRequest.prototype.getUTCtimestamp = function ()
{
//var currentTime = new Date();
//var currentUTCTimeInSecs =
Math.floor(Date.parse(currentTime.toUTCString()) / 1000);
//return currentUTCTimeInSecs;
return (new Date((new Date).toUTCString())).getTime() / 1000;
}

// don't forget trailing !
//TwitterApiRequest.prototype.consumerSecret =
MY consumerSecret ;

TwitterApiRequest.prototype.signatureBaseStringTemplate = POST +
https%3A%2F%2Fapi.twitter.com
http://2fapi.twitter.com/%2Foauth%2Faccess_token
+ // oauth_path
oauth_consumer_key%3DMY CONSUMER KEY%26 +
oauth_nonce%3D + {{ nonce }} + %26 +
oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D + {{ time }} +
%26 +
oauth_version%3D1.0%26 +
x_auth_mode%3Dclient_auth%26 +
x_auth_password%3D + {{ password }} + %26 +
x_auth_username%3D + {{ username }}

TwitterApiRequest.prototype.authHeaderTemplate = OAuth  +
oauth_nonce=\ + {{ nonce }} + \,  +
oauth_signature_method=\HMAC-SHA1\,  +
oauth_timestamp=\ + {{ time }} + \,  +
oauth_consumer_key=\MY CONSUMER KEY\,  +
oauth_signature=\ + {{ signature }} + \,  +
oauth_version=\1.0\;

TwitterApiRequest.prototype.processCredentials = function (user, pw) {
this.signatureBaseString = this.signatureBaseStringTemplate
.split({{ nonce }}).join(this.nonce)
.split({{ time }}).join(this.timestamp)
.split({{ password
}}).join(encodeURIComponent(pw))
.split({{ username
}}).join(encodeURIComponent(user));

this.postBody = x_auth_mode=client_auth +
x_auth_password= + encodeURIComponent(pw) +  +
x_auth_username= + encodeURIComponent(user);
}

TwitterApiRequest.prototype.sign = function ()
{
//var shaObj = new jsSHA(base_string, ASCII);
//var oauth_signature = shaObj.getHMAC(consumersecret, ASCII, B64);
alert(this.signatureBaseString :+this.signatureBaseString);
var hmacGen = new jsSHA(this.signatureBaseString,ASCII);
this.signature = hmacGen.getHMAC(this.consumerSecret,ASCII,B64)+%3D;


this.authHeader = this.authHeaderTemplate
.split({{ nonce }}).join(this.nonce)
.split({{ time }}).join(this.timestamp)
.split({{ signature }}).join(this.signature);
}

function ajaxrequest()
{
var authorizeRequest = new TwitterApiRequest();
authorizeRequest.processCredentials(suyambu.vikn...@gmail.com,
simcard00);
authorizeRequest.sign();

var twitterUrl = 'https://api.twitter.com/oauth/access_token?' +
authorizeRequest.postBody;

var req = new XMLHttpRequest();
alert(this.postBody : +authorizeRequest.postBody);
alert(header :+authorizeRequest.authHeader);
// sync for testing purposes, not required
req.open('POST', twitterUrl, false);
req.setRequestHeader(Authorization, authorizeRequest.authHeader);
req.send();
alert(Response :+req.responseText);
// should be 200
//console.log(req.status);
alert(Status :+req.status);
// should look like:
//
oauth_token=HERE-IS-MY-AWESOME-TOKENoauth_token_secret=THIS-IS-MY-TOKEN-SECRET
// user_id=007screen_name=JamesBondx_auth_expires=0
//console.log(req.responseText);
}

/script
/head

body onLoad=ajaxrequest();

/body
/html










On Sat, Dec 4, 2010 at 4:35 PM, Tom van der Woerdt i...@tvdw.eu wrote:

 You really shouldn't implement xAuth in JavaScript for obvious reasons,
 like how impossible it is to keep your keys secret.

 Tom




 On 12/4/10 6:19 AM, mahesh wrote:

 HI Team,

 Here i have been getting the following problem.

 I can able to post the message to twitter using xAuth Protocol in
 safari
 but i can't from firefox ,samsung tv browser Maple and IE.

 I am using javascript xmlhttprequest and sha1 for signature.

 Is twitter send response when we  request from samsung tv
 maple browser?.

 More over when i try to request from samsung tv maple browser

 i get 

[twitter-dev] statuses/user_timeline count bug

2010-12-06 Thread L0rdJ
I found a bug in the Twitter API, but i can`t find where i can report
in, so i decided report it to this group, with hope that somebody help
me :)

Seems like when i`m setting count parameter for statuses/
user_timeline API call, but i`m not setting include_rts parameter.
Returned statuses are limited including retweets. But retweets aren`t
displayed.

So if i have
1. some tweet 1
2. retweet to some tweet 1
3. retweet to some tweet 1
4. some tweet 2
5. some tweet 3


and i`m trying to get statuses/user_timeline with count = 3, and
disabled include_rts. I got:
1. Some tweet 1
Instead of
1. Some tweet 1
2. Some tweet 2
3. Some tweet 3

-- 
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


Re: [twitter-dev] statuses/user_timeline count bug

2010-12-06 Thread Taylor Singletary
Hi L0rdJ,

This is how the Twitter REST API count parameters work -- they are hopeful
counts -- you won't get more than the count specified but you may get less.
This is one reason you see many web-based Twitter clients utilize a More
button approach rather than paged results. It's best to focus less on the
literal count of results that you get back and instead on the content.

Taylor

On Mon, Dec 6, 2010 at 4:37 AM, L0rdJ dolgushev.ser...@gmail.com wrote:

 I found a bug in the Twitter API, but i can`t find where i can report
 in, so i decided report it to this group, with hope that somebody help
 me :)

 Seems like when i`m setting count parameter for statuses/
 user_timeline API call, but i`m not setting include_rts parameter.
 Returned statuses are limited including retweets. But retweets aren`t
 displayed.

 So if i have
 1. some tweet 1
 2. retweet to some tweet 1
 3. retweet to some tweet 1
 4. some tweet 2
 5. some tweet 3
 

 and i`m trying to get statuses/user_timeline with count = 3, and
 disabled include_rts. I got:
 1. Some tweet 1
 Instead of
 1. Some tweet 1
 2. Some tweet 2
 3. Some tweet 3

 --
 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] oauth_callback

2010-12-06 Thread Mark Krieger
I've been using a development site to work on a twitter related
project until a few weeks ago, but I cut over to our real production
site. Let's call development: mydev.com, and production: myprod.com. I
had changed my twitter domain for callbacks to prod.com, no problem
when I did this. Since I use cookies to manage which subdomain will be
authenticated, I cannot have both dev and prod use cookies to get back
to the correct domain (one of the cookies is the real url of the
caller, so the dev domain cannot even see the cookie).

I read about oauth_callback today, just to see if I could make this
work for any general domain I might run my application on. First, I
added mydev.com as a domain to my twitter app. Then I changed the
requesttoken to use a simple oauth_callback on the dev site of
http://mydev.com/proj/confirm (the registered callback is
http://myprod.com/proj/confirm).

When I call twitter on return  -- and it returns to the right place!!!
-, it gets an 'unexpected twitter failure' with nothing in any error
string while calling  my library's  function to get the oauth token
and secret.

My question, finally: Did I miss some step here? Otherwise the code
for mydev and myprod is identical.  Do different domains have
different ouath tokens in some way for the same application or
something?

thanks,

Mark

-- 
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] Photo Upload

2010-12-06 Thread Guilherme A M Ferreira
Guys,

I am new at Twitter API and I've been reading the API doc to figure out how
it works. What brought me here is a customer's requirement that I would like
you to help me on.
A promotion will happen based on Twitter where customers that follows my
customer's user will have to send photos like Twitpic , Plixi and so on and
a team will evaluate those photos to judge it and come up with the best
photos across the country.

They don't want to use these existing services, they want (must) store the
photos on their own server so basically I need to write a Twitpic-like app.
Is there functions available in the API to accomplish what I would like to
do ? When the user twits and attach a photo I'd like to send this photo to
my app (I am aware they would need to change their photo settings).

Thanks in advance

Regards,
G.

-- 
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] Counter of hashtag

2010-12-06 Thread alex.prg
Good Afternoon,

I'm new to twitter API and I need help.

I am needing to know where to start making a page. Php that
return the amount of hastag.

Can anyone help me please?

Thanks,

Alex

-- 
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


Re: [twitter-dev] Photo Upload

2010-12-06 Thread Taylor Singletary
Images in tweets on Twitter are communicated by attaching a URL to the tweet
that points to a picture. Some photo sharing services have become
somewhat institutionalized through their use on Twitter -- many Twitter
clients are built to understand when a link points to a photo on Plixi or
the like.

If you're going down the path of creating your own photo sharing service for
Twitter, you'll be at a disadvantage to the other offerings for this reason.
The majority of your costs in this project will be in storage and bandwidth.
The most relevant piece of the Twitter API for you will be the status update
posting API, which will allow you to create tweets with links pointing to
photos hosted on your servers -- the Twitter API doesn't provide any means
to attach an image directly with a tweet.

Taylor

On Mon, Dec 6, 2010 at 9:27 AM, Guilherme A M Ferreira 
gmendes.ferre...@gmail.com wrote:

 Guys,

 I am new at Twitter API and I've been reading the API doc to figure out how
 it works. What brought me here is a customer's requirement that I would like
 you to help me on.
 A promotion will happen based on Twitter where customers that follows my
 customer's user will have to send photos like Twitpic , Plixi and so on and
 a team will evaluate those photos to judge it and come up with the best
 photos across the country.

 They don't want to use these existing services, they want (must) store the
 photos on their own server so basically I need to write a Twitpic-like app.
 Is there functions available in the API to accomplish what I would like to
 do ? When the user twits and attach a photo I'd like to send this photo to
 my app (I am aware they would need to change their photo settings).

 Thanks in advance

 Regards,
 G.

 --
 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


Re: [twitter-dev] Photo Upload

2010-12-06 Thread Guilherme A M Ferreira
Hi Taylor,

Thanks for your response.
In this case they are aware of the bandwidth and storage needed.

I'll look at the piece of the Twitter API that you mentioned.

Regards


On Mon, Dec 6, 2010 at 4:25 PM, Taylor Singletary 
taylorsinglet...@twitter.com wrote:

 Images in tweets on Twitter are communicated by attaching a URL to the
 tweet that points to a picture. Some photo sharing services have become
 somewhat institutionalized through their use on Twitter -- many Twitter
 clients are built to understand when a link points to a photo on Plixi or
 the like.

 If you're going down the path of creating your own photo sharing service
 for Twitter, you'll be at a disadvantage to the other offerings for this
 reason. The majority of your costs in this project will be in storage and
 bandwidth. The most relevant piece of the Twitter API for you will be the
 status update posting API, which will allow you to create tweets with links
 pointing to photos hosted on your servers -- the Twitter API doesn't provide
 any means to attach an image directly with a tweet.

 Taylor

 On Mon, Dec 6, 2010 at 9:27 AM, Guilherme A M Ferreira 
 gmendes.ferre...@gmail.com wrote:

 Guys,

 I am new at Twitter API and I've been reading the API doc to figure out
 how it works. What brought me here is a customer's requirement that I would
 like you to help me on.
 A promotion will happen based on Twitter where customers that follows my
 customer's user will have to send photos like Twitpic , Plixi and so on and
 a team will evaluate those photos to judge it and come up with the best
 photos across the country.

 They don't want to use these existing services, they want (must) store the
 photos on their own server so basically I need to write a Twitpic-like app.
 Is there functions available in the API to accomplish what I would like to
 do ? When the user twits and attach a photo I'd like to send this photo to
 my app (I am aware they would need to change their photo settings).

 Thanks in advance

 Regards,
 G.

 --
 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] XML disabled on Streaming API

2010-12-06 Thread John Kalucki
As previously announced, XML has been disabled on the Streaming API. The few
remaining consumers should move to JSON, and bid the year 2003 adieu.

-John Kalucki
http://twitter.com/jkalucki
Twitter, Inc.

-- 
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] Streaming API, GeoLocation Filtering

2010-12-06 Thread Eric
Hello all,


Just a general question about a location-based predicate. According to
the streaming API docs...

Only tweets that are both created using the Geotagging API and are
placed from within a tracked bounding box will be included in the
stream...

But, as other have pointed out, a lot/most of the statuses that come
back from such a filtered query don't always contain GeoLocation data.
So... what's going on here? Am I missing something? I'm not
necessarily concerned that I'm getting more data than I can use
(although it's unfortunate from a rate-limiting standpoint), but my
curiosity is certainly piqued.

For the project I'm working on (I'm a grad student), I'm trying to
listen to activity in different locations and sonify it on the fly.
In keeping with best practices, I build one filter predicate for a
handful of locations and try to make sense of the data as it comes by,
rather than opening a handful of streams. As a result, I end up with a
great many tweets I can't attribute to a geographic source, sans
GeoLocation data. Based on the wording above though, I understand it
to mean a status that clears the filter should have that information.

Any insight would be greatly appreciated.


Best,
Eric Humphrey

-- 
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: Snowflake, it's almost 9007199254740992 time.

2010-12-06 Thread themattharris
Hi Kevin,

Thanks again for pointing this out. We've updated the gist with a fix
for the issue you identified:
https://gist.github.com/637624

Best,
@themattharris

On Dec 3, 3:23 pm, Matt Harris thematthar...@twitter.com wrote:
 Thanks for pointing this out Kevin. I've passed this onto the engineers for
 review.

 Best
 @themattharris
 Developer Advocate, Twitterhttp://twitter.com/themattharris

 On Fri, Dec 3, 2010 at 11:10 AM, Kevin Watters kevinwatt...@gmail.comwrote:







  Beware the natural order comparison code linked above.
  natcompare(10705970246197248, 625058521088) returns -1
  incorrectly. Seehttps://gist.github.com/727383for an example.

  On Nov 23, 12:26 pm, Matt Harris thematthar...@twitter.com wrote:
   Hey everyone,

   You may remember a few weeks ago we launched Snowflake having encouraged
  you
   all to check your code to make sure you were able to handle the larger
   numbers it will generate. For those of you whose code couldn't handle the
   longer numbers we created String versions of the IDs in our JSON
  responses,
   identified by an _str at the end of their name - for example the Tweet
  ID
   in the JSON response exists twice: once as a number (id) and once as a
   string (id_str). For API requests which returned arrays of IDs we added
  the
   parameter stringify_ids to force all IDs to Strings. For example:

 https://api.twitter.com/1/followers/ids.json?cursor=-1stringify_ids=1

   We're sending this reminder because at 2.14pm PDT (10.14pm UTC) this
  Sunday,
   28th November 2010 Snowflake IDs will reach 53bits.

   Only Tweet IDs are generated by Snowflake. This means only Tweets,
  Retweets,
   Mentions and Replies are affected this weekend. Things like Saved
  Searches,
   Users and Direct Messages are not Snowflaked.

   If you haven't converted your code to use the String version you should
  do
   so immediately. Once the IDs reach 53bits Javascript, and some other
   languages, misrepresent the numbers. As an example: 2**53 =
  9007199254740992

   Representing this in Javascript gives

(9007199254740992).toString()
   9007199254740992
(9007199254740993).toString()
   9007199254740992
(9007199254740994).toString()
   9007199254740994
(9007199254740995).toString()
   9007199254740996
(9007199254740999).toString()

   9007199254741000

   You can see in this example that the Tweet IDs are being misrepresented
  in
   their converted state. We've provided String versions of all of our IDs,
   even those which are not using Snowflake IDs. We've done this to make it
   easier for you to convert your code. Even if your code can handle the
  longer
   numbers you may want to convert to Strings anyway. Doing so will reduce
  the
   risk of problems should you extend your code with a language or library
  that
   doesn't support 53bit numbers.

   If you are using Javascript you may find the following code samples
  helpful.
   They were put together by our web team as an example approach to the
  problem
   of capturing the String version of the IDs, and sorting them.

   The first gist looks for the new *_str field and uses it if it's there.
   If
   it's missing, the original field is used but stringified first. This
  doesn't
   make IDs 53bit safe for you but but does mean you can use String IDs for
   all other attributes without having to check for them first.

   The second code sample using the library natcompare.js which performs
   'natural order' comparisons of strings in JavaScript. It was written by
   Kristof Coomans of the SCK-CEN (Belgian Nucleair Research Centre).
      http://gist.github.com/637624

   There has been some great discussion about this in the developer forums,
   including some questions and answers about the change. You can read more
   here:

  http://groups.google.com/group/twitter-development-talk/browse_thread...

   Best,
   @themattharris
   Developer Advocate, Twitter

  --
  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


Re: [twitter-dev] XML disabled on Streaming API

2010-12-06 Thread M. Edward (Ed) Borasky

Quoting John Kalucki j...@twitter.com:


As previously announced, XML has been disabled on the Streaming API. The few
remaining consumers should move to JSON, and bid the year 2003 adieu.


Sigh ... anyone want to buy a used but serviceable 56K modem? ;-)

--
M. Edward (Ed) Borasky
http://borasky-research.net http://twitter.com/znmeb

A mathematician is a device for turning coffee into theorems. - Paul Erdos


--
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: XML disabled on Streaming API

2010-12-06 Thread @giromide
I put a star on this thread. Will this count as a favorite?

On Dec 6, 2:17 pm, M. Edward (Ed) Borasky zn...@borasky-
research.net wrote:
 Quoting John Kalucki j...@twitter.com:

  As previously announced, XML has been disabled on the Streaming API. The few
  remaining consumers should move to JSON, and bid the year 2003 adieu.

 Sigh ... anyone want to buy a used but serviceable 56K modem? ;-)

 --
 M. Edward (Ed) Boraskyhttp://borasky-research.nethttp://twitter.com/znmeb

 A mathematician is a device for turning coffee into theorems. - Paul Erdos

-- 
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: Counter of hashtag

2010-12-06 Thread Ryan
Also interested.

-- 
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: xAuth Request gives Error from samsung tv maple browser

2010-12-06 Thread Bess
I am interested in solving this too.

Let's say Samsung TV is same as desk top. You should be able to use
xAuth.

You need to create a new Twitter app to get Consumer key and Consumer
secret. Make sure you select client method and read/write.

On Dec 6, 1:23 am, umamahesh G. g.umamahesh...@gmail.com wrote:
 HI Tom,

 Thanks for your support. I am using javascript for samsung TV Applicaiton
 not for normal browser so there is no way to know about keys and secret
 key.Actually Samsung SDK uses Maple browser and  application runs on  this
 browser.

 I hope you help me out from this issue.

 Please find the below code.

 html
 head
 lt;script type =text/Javascript language=Javascript
 src=sha1.js/script
 lt;script type=text/javascript charset=utf-8

 /*To authorize on Twitter API through xAuth, you need HMAC-SHA1
 I'm using the following lib for that:http://jssha.sourceforge.net
 Make sure you have sha.js included!Also, you need to email
 a...@twitter.comto get xAuth access
 I cannot do that for you - seehttp://dev.twitter.com/pages/xauth
 cross-domain XHRs only work on file:// protocol pages
 use PhoneGap!
  */

 var TwitterApiRequest = function() {
 this.nonce = this.generateNonce();
 this.timestamp = this.getUTCtimestamp();

 this.postBody = null;
 this.signature = null;
 this.signatureBaseString = null;
 this.consumerSecret=MY consumerSecret ;

 }

 TwitterApiRequest.prototype.generateNonce = function () {
 var nonce = [];
 var length = 6; // arbitrary - looks like a good length

 for (length; length  0; length--)
 nonce.push1+Math.random())*0x1)|0).toString(16).substring(1));

 return nonce.join();

 }

 // could possibly do without UTC, but here we are
 TwitterApiRequest.prototype.getUTCtimestamp = function ()
 {
 //var currentTime = new Date();
 //var currentUTCTimeInSecs =
 Math.floor(Date.parse(currentTime.toUTCString()) / 1000);
 //return currentUTCTimeInSecs;
 return (new Date((new Date).toUTCString())).getTime() / 1000;

 }

 // don't forget trailing !
 //TwitterApiRequest.prototype.consumerSecret =
 MY consumerSecret ;

 TwitterApiRequest.prototype.signatureBaseStringTemplate = POST +
 https%3A%2F%2Fapi.twitter.com
 http://2fapi.twitter.com/%2Foauth%2Faccess_token
 + // oauth_path
 oauth_consumer_key%3DMY CONSUMER KEY%26 +
 oauth_nonce%3D + {{ nonce }} + %26 +
 oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D + {{ time }} +
 %26 +
 oauth_version%3D1.0%26 +
 x_auth_mode%3Dclient_auth%26 +
 x_auth_password%3D + {{ password }} + %26 +
 x_auth_username%3D + {{ username }}

 TwitterApiRequest.prototype.authHeaderTemplate = OAuth  +
 oauth_nonce=\ + {{ nonce }} + \,  +
 oauth_signature_method=\HMAC-SHA1\,  +
 oauth_timestamp=\ + {{ time }} + \,  +
 oauth_consumer_key=\MY CONSUMER KEY\,  +
 oauth_signature=\ + {{ signature }} + \,  +
 oauth_version=\1.0\;

 TwitterApiRequest.prototype.processCredentials = function (user, pw) {
 this.signatureBaseString = this.signatureBaseStringTemplate
 .split({{ nonce }}).join(this.nonce)
 .split({{ time }}).join(this.timestamp)
 .split({{ password

 }}).join(encodeURIComponent(pw))
 .split({{ username
 }}).join(encodeURIComponent(user));

 this.postBody = x_auth_mode=client_auth +
 x_auth_password= + encodeURIComponent(pw) +  +
 x_auth_username= + encodeURIComponent(user);

 }

 TwitterApiRequest.prototype.sign = function ()
 {
 //var shaObj = new jsSHA(base_string, ASCII);
 //var oauth_signature = shaObj.getHMAC(consumersecret, ASCII, B64);
 alert(this.signatureBaseString :+this.signatureBaseString);
 var hmacGen = new jsSHA(this.signatureBaseString,ASCII);
 this.signature = hmacGen.getHMAC(this.consumerSecret,ASCII,B64)+%3D;

 this.authHeader = this.authHeaderTemplate
 .split({{ nonce }}).join(this.nonce)
 .split({{ time }}).join(this.timestamp)
 .split({{ signature }}).join(this.signature);

 }

 function ajaxrequest()
 {
 var authorizeRequest = new TwitterApiRequest();
 authorizeRequest.processCredentials(suyambu.vikn...@gmail.com,
 simcard00);
 authorizeRequest.sign();

 var twitterUrl = 'https://api.twitter.com/oauth/access_token?'+
 authorizeRequest.postBody;

 var req = new XMLHttpRequest();
 alert(this.postBody : +authorizeRequest.postBody);
 alert(header :+authorizeRequest.authHeader);
 // sync for testing purposes, not required
 req.open('POST', twitterUrl, false);
 req.setRequestHeader(Authorization, authorizeRequest.authHeader);
 req.send();
 alert(Response :+req.responseText);
 // should be 200
 //console.log(req.status);
 alert(Status :+req.status);
 // should look like:
 //
 oauth_token=HERE-IS-MY-AWESOME-TOKENoauth_token_secret=THIS-IS-MY-TOKEN-SECRET
 // user_id=007screen_name=JamesBondx_auth_expires=0
 //console.log(req.responseText);

 }

 /script
 /head

 body onLoad=ajaxrequest();

 /body
 /html

 On Sat, Dec 4, 2010 at 4:35 PM, Tom van der Woerdt i...@tvdw.eu wrote:



  You really shouldn't implement xAuth in JavaScript for obvious reasons,
  like how impossible it is to keep your keys secret.

  Tom

  On 12/4/10 6:19 AM, 

[twitter-dev] tweet number

2010-12-06 Thread makendall
hey twitter people,

I was wondering if there was a problem going on twitter. I have
concerns because I have tweeted nearly 3,000 times and when i logged
on to twitter today i noticed that i only had 180 tweets. This really
isn't a big problem but i tweeted many times to get where i was. I was
just wondering if it was just a glitch in the system or what.
   thank you,
Makendall McCree

-- 
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: Photo Upload

2010-12-06 Thread L. Mohan Arun
 Is there functions available in the API to accomplish what I would like to
 do ?

Twitter doesnt handle pictures. Only text.

 When the user twits and attach a photo I'd like to send this photo to
 my app (I am aware they would need to change their photo settings).

Let the users tweet normally with a particular hashtag say #contest4xv
Use search API to get all tweets tagged with this hashtag.
Parse the tweet to get the twitpic.com/ url. example http://twitpic.com/3705ya
Use standard HTTP client library to parse the url and grab the image
to your own database.

~~~ Mohan Arun

-- 
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: Unfollow

2010-12-06 Thread L. Mohan Arun
 Is there any way to find out where users from Unfollow other User

You said what I had in mind.
There needs to be a way where twitter exposes events via another
firehose API (Events).

API request: events i am interested in: [follows, unfollows] as
pertaining to [User2]
User1 started following User2
User1 unfollowed User2

API request: events i am interested in: [retweets, favorites] by
minimum [50] people.
User1's tweet (id:) got favorited by 50 people.
User1's tweet (id:) got retweeted 50 times.

\
If you are only looking to get notified when someone unfollows you
simply follow @unfollowr. It DMs you when someone unfollows you
~~~ Mohan Arun

-- 
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: Counter of hashtag

2010-12-06 Thread L. Mohan Arun
 I am needing to know where to start making a page. Php that
 return the amount of hastag.

Use Search API. http://dev.twitter.com/doc/get/search
See 5th example under Example queries:

~~~ Mohan Arun

-- 
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


Re: [twitter-dev] Re: xAuth Request gives Error from samsung tv maple browser

2010-12-06 Thread umamahesh G.
HI Tom,

Thanks for you kind support.I had all required privileges from twitter for
my app.The thing is i can able to post the message from safari but same
code not working in firefox,IE as well as samsung Tv.Please help me out from
this problem.I tried maximum ways still i don't have any solution.

On Tue, Dec 7, 2010 at 5:48 AM, Bess bess...@gmail.com wrote:

 I am interested in solving this too.

 Let's say Samsung TV is same as desk top. You should be able to use
 xAuth.

 You need to create a new Twitter app to get Consumer key and Consumer
 secret. Make sure you select client method and read/write.

 On Dec 6, 1:23 am, umamahesh G. g.umamahesh...@gmail.com wrote:
  HI Tom,
 
  Thanks for your support. I am using javascript for samsung TV Applicaiton
  not for normal browser so there is no way to know about keys and secret
  key.Actually Samsung SDK uses Maple browser and  application runs on
  this
  browser.
 
  I hope you help me out from this issue.
 
  Please find the below code.
 
  html
  head
  lt;script type =text/Javascript language=Javascript
  src=sha1.js/script
  lt;script type=text/javascript charset=utf-8
 
  /*To authorize on Twitter API through xAuth, you need HMAC-SHA1
  I'm using the following lib for that:http://jssha.sourceforge.net
  Make sure you have sha.js included!Also, you need to email
  a...@twitter.comto get xAuth access
  I cannot do that for you - seehttp://dev.twitter.com/pages/xauth
   cross-domain XHRs only work on file:// protocol pages
  use PhoneGap!
   */
 
  var TwitterApiRequest = function() {
  this.nonce = this.generateNonce();
  this.timestamp = this.getUTCtimestamp();
 
  this.postBody = null;
  this.signature = null;
  this.signatureBaseString = null;
  this.consumerSecret=MY consumerSecret ;
 
  }
 
  TwitterApiRequest.prototype.generateNonce = function () {
  var nonce = [];
  var length = 6; // arbitrary - looks like a good length
 
  for (length; length  0; length--)
  nonce.push1+Math.random())*0x1)|0).toString(16).substring(1));
 
  return nonce.join();
 
  }
 
  // could possibly do without UTC, but here we are
  TwitterApiRequest.prototype.getUTCtimestamp = function ()
  {
  //var currentTime = new Date();
  //var currentUTCTimeInSecs =
  Math.floor(Date.parse(currentTime.toUTCString()) / 1000);
  //return currentUTCTimeInSecs;
  return (new Date((new Date).toUTCString())).getTime() / 1000;
 
  }
 
  // don't forget trailing !
  //TwitterApiRequest.prototype.consumerSecret =
  MY consumerSecret ;
 
  TwitterApiRequest.prototype.signatureBaseStringTemplate = POST +
  https%3A%2F%2Fapi.twitter.com http://2fapi.twitter.com/
  http://2fapi.twitter.com/%2Foauth%2Faccess_token
   + // oauth_path
  oauth_consumer_key%3DMY CONSUMER KEY%26 +
  oauth_nonce%3D + {{ nonce }} + %26 +
  oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D + {{ time }}
 +
  %26 +
  oauth_version%3D1.0%26 +
  x_auth_mode%3Dclient_auth%26 +
  x_auth_password%3D + {{ password }} + %26 +
  x_auth_username%3D + {{ username }}
 
  TwitterApiRequest.prototype.authHeaderTemplate = OAuth  +
  oauth_nonce=\ + {{ nonce }} + \,  +
  oauth_signature_method=\HMAC-SHA1\,  +
  oauth_timestamp=\ + {{ time }} + \,  +
  oauth_consumer_key=\MY CONSUMER KEY\,  +
  oauth_signature=\ + {{ signature }} + \,  +
  oauth_version=\1.0\;
 
  TwitterApiRequest.prototype.processCredentials = function (user, pw) {
  this.signatureBaseString = this.signatureBaseStringTemplate
  .split({{ nonce }}).join(this.nonce)
  .split({{ time }}).join(this.timestamp)
  .split({{ password
 
  }}).join(encodeURIComponent(pw))
  .split({{ username
  }}).join(encodeURIComponent(user));
 
  this.postBody = x_auth_mode=client_auth +
  x_auth_password= + encodeURIComponent(pw) +  +
  x_auth_username= + encodeURIComponent(user);
 
  }
 
  TwitterApiRequest.prototype.sign = function ()
  {
  //var shaObj = new jsSHA(base_string, ASCII);
  //var oauth_signature = shaObj.getHMAC(consumersecret, ASCII, B64);
  alert(this.signatureBaseString :+this.signatureBaseString);
  var hmacGen = new jsSHA(this.signatureBaseString,ASCII);
  this.signature =
 hmacGen.getHMAC(this.consumerSecret,ASCII,B64)+%3D;
 
  this.authHeader = this.authHeaderTemplate
  .split({{ nonce }}).join(this.nonce)
  .split({{ time }}).join(this.timestamp)
  .split({{ signature }}).join(this.signature);
 
  }
 
  function ajaxrequest()
  {
  var authorizeRequest = new TwitterApiRequest();
  authorizeRequest.processCredentials(suyambu.vikn...@gmail.com,
  simcard00);
  authorizeRequest.sign();
 
  var twitterUrl = 'https://api.twitter.com/oauth/access_token?'+
  authorizeRequest.postBody;
 
  var req = new XMLHttpRequest();
  alert(this.postBody : +authorizeRequest.postBody);
  alert(header :+authorizeRequest.authHeader);
  // sync for testing purposes, not required
  req.open('POST', twitterUrl, false);
  req.setRequestHeader(Authorization, authorizeRequest.authHeader);
  req.send();
  alert(Response :+req.responseText);
  // should be 200