[twitter-dev] Re: j2me twitter

2010-09-11 Thread j2me
Other question too.

When i tried those codes form www.twitterapime.com ,
once my program caught an exception(however now I forgot what that
exception was) and sometime says could not verify(according to my
program, I displayed could not verify while verifyCredential()
returned false).

Is that because of my consumer key and consumer secret?

And still I am not out of this oAuth...

-- 
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?hl=en


[twitter-dev] Re: help with accessing the streaming api

2010-09-11 Thread omri
I request this URL :
http://stream.twitter.com/1/statuses/firehose.json

i get this message on my compiler :
WARNING  2010-09-11 07:31:30,447 urlfetch_stub.py:284] Stripped
prohibited headers from URLFetch request: ['Host']

i think something is wrong with my permission.

I read this doc.

This is the code i wrote in prder to use the streaming :

status_url = http://stream.twitter.com/1/statuses/firehose.json;
request = urllib2.Request(status_url)
auth = base64.encodestring('(username):(password)')[:-1]
request.add_header('Authorization', basic %s % auth)
firehose = urllib2.urlopen(request)
for tweet in firehose:
print tweet

firehose.close

thanks again



On 9 ספטמבר, 18:02, John Kalucki j...@twitter.com wrote:
 Which URL are you requesting? What is the text message returned? Does this
 doc help?http://dev.twitter.com/pages/streaming_api_response_codes

 -John



 On Thu, Sep 9, 2010 at 7:45 AM, omri omridek...@gmail.com wrote:
  so..
  succeded with the username and password but now i have :
  HTTPError: HTTP Error 403: Forbidden

  I need something special to have access to the streaming resources?

  On 9 ספטמבר, 17:03, Taylor Singletary taylorsinglet...@twitter.com
  wrote:
   Hi Omri,

   With basic auth, you don't use your consumer key or secret at all.
  Consumer
   key and secret are used when authorizing through OAuth, and the
   implementation is a bit more detailed than putting them in a header.

   In your case, you want to use basic authorization, which should be easier
   for your initial implementation.

   Here are some pointers in the right direction for using basic auth with
   Python's urllib2:http://docs.python.org/library/urllib2.html#examples

   Taylor

   On Thu, Sep 9, 2010 at 6:56 AM, omri omridek...@gmail.com wrote:
this is the message i get :

 File quot;C:\Python26\lib\urllib2.pyquot;, line 516, in
http_error_default
   raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized

i think i dont know which username and password to type in the header
- 'Authorization' 'basic (username:password)
the twitter's username?
the twitter api oauth?

thanks

On 9 ספטמבר, 15:42, John Kalucki j...@twitter.com wrote:
 What text message does it return with the 401 error?

 You can still use basic auth with streaming. Does that work for you?
  You
 should use your screenname and password for basic auth.

 -John Kaluckihttp://twitter.com/jkalucki
 Twitter, Inc.

 On Thu, Sep 9, 2010 at 2:48 AM, omri omridek...@gmail.com wrote:
  hi,
  now it returns the 401 error.
  It seems like I don't know what is the username and password i
  should
  insert.

  is this ths oauth token?
  what is the title of this fields?

  API key, Consumer key, Consumer secret?

  thanks

  On 7 ספטמבר, 17:16, John Kalucki j...@twitter.com wrote:
   The Streaming API will print a short text message along with
  errors
that
  is
   often a very explicit indication of the problem. I don't think it
throws
  500
   errors (see:
   http://dev.twitter.com/pages/streaming_api_response_codes)
  so
   something odd is going on. If anything, it is throwing a 406, as
  you
  haven't
   provided parameters to track.

   -John Kaluckihttp://twitter.com/jkalucki
   Twitter, Inc.

   On Tue, Sep 7, 2010 at 4:38 AM, omri omridek...@gmail.com
  wrote:
def run (self):
   status_url = 
 http://stream.twitter.com/1/statuses/filter.json;
   request = urllib2.Request(status_url)
   print request
   auth = base64.encodestring('Consumer key:Consumer
  secret')[:-1]
   request.add_header('Authorization', 'basic %s' % auth)
   firehose = urllib2.urlopen(request)
   for tweet in firehose:
       print tweet

   firehose.close

when printing the request i have  500 error, it is not
  reachable.

do you have an idea why?

--
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?hl=en

  --
  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?hl=en

--
Twitter developer documentation and resources:
 http://dev.twitter.com/doc
API updates via Twitter:http://twitter.com/twitterapi
Issues/Enhancements Tracker:
   

[twitter-dev] Entities display_url and expanded_url

2010-09-11 Thread Rich
Hi

I have a question for the API team.  I notice that display_url doesn't
contain the protocol e.g. http:// or https:// yet expanded_url does.

Would I be safe to assume that a urlhttp://t.co/xx/url would
always contain an expanded_url as well as a display_url?

Richard

-- 
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?hl=en


Re: [twitter-dev] Re: help with accessing the streaming api

2010-09-11 Thread John Kalucki
I think the best debugging process is to reproduce your problem in curl,
then show the curl -v output (passwords elided, naturally). If curl works
and your home-rolled client does not, then you can use tcpdump(1) or some
other packet sniffer and work out the deltas between the working solution
and the non-working solution.

In this case, do you have access to the firehose? Can you use an existing
client library? There are dozens of clients for the Streaming API out there.

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



On Sat, Sep 11, 2010 at 12:36 AM, omri omridek...@gmail.com wrote:

 I request this URL :
 http://stream.twitter.com/1/statuses/firehose.json

 i get this message on my compiler :
 WARNING  2010-09-11 07:31:30,447 urlfetch_stub.py:284] Stripped
 prohibited headers from URLFetch request: ['Host']

 i think something is wrong with my permission.

 I read this doc.

 This is the code i wrote in prder to use the streaming :

 status_url = http://stream.twitter.com/1/statuses/firehose.json;
 request = urllib2.Request(status_url)
 auth = base64.encodestring('(username):(password)')[:-1]
 request.add_header('Authorization', basic %s % auth)
firehose = urllib2.urlopen(request)
for tweet in firehose:
print tweet

firehose.close

 thanks again



 On 9 ספטמבר, 18:02, John Kalucki j...@twitter.com wrote:
  Which URL are you requesting? What is the text message returned? Does
 this
  doc help?http://dev.twitter.com/pages/streaming_api_response_codes
 
  -John
 
 
 
  On Thu, Sep 9, 2010 at 7:45 AM, omri omridek...@gmail.com wrote:
   so..
   succeded with the username and password but now i have :
   HTTPError: HTTP Error 403: Forbidden
 
   I need something special to have access to the streaming resources?
 
   On 9 ספטמבר, 17:03, Taylor Singletary taylorsinglet...@twitter.com
   wrote:
Hi Omri,
 
With basic auth, you don't use your consumer key or secret at all.
   Consumer
key and secret are used when authorizing through OAuth, and the
implementation is a bit more detailed than putting them in a header.
 
In your case, you want to use basic authorization, which should be
 easier
for your initial implementation.
 
Here are some pointers in the right direction for using basic auth
 with
Python's urllib2:
 http://docs.python.org/library/urllib2.html#examples
 
Taylor
 
On Thu, Sep 9, 2010 at 6:56 AM, omri omridek...@gmail.com wrote:
 this is the message i get :
 
  File quot;C:\Python26\lib\urllib2.pyquot;, line 516, in
 http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
 HTTPError: HTTP Error 401: Unauthorized
 
 i think i dont know which username and password to type in the
 header
 - 'Authorization' 'basic (username:password)
 the twitter's username?
 the twitter api oauth?
 
 thanks
 
 On 9 ספטמבר, 15:42, John Kalucki j...@twitter.com wrote:
  What text message does it return with the 401 error?
 
  You can still use basic auth with streaming. Does that work for
 you?
   You
  should use your screenname and password for basic auth.
 
  -John Kaluckihttp://twitter.com/jkalucki
  Twitter, Inc.
 
  On Thu, Sep 9, 2010 at 2:48 AM, omri omridek...@gmail.com
 wrote:
   hi,
   now it returns the 401 error.
   It seems like I don't know what is the username and password i
   should
   insert.
 
   is this ths oauth token?
   what is the title of this fields?
 
   API key, Consumer key, Consumer secret?
 
   thanks
 
   On 7 ספטמבר, 17:16, John Kalucki j...@twitter.com wrote:
The Streaming API will print a short text message along with
   errors
 that
   is
often a very explicit indication of the problem. I don't
 think it
 throws
   500
errors (see:
http://dev.twitter.com/pages/streaming_api_response_codes)
   so
something odd is going on. If anything, it is throwing a 406,
 as
   you
   haven't
provided parameters to track.
 
-John Kaluckihttp://twitter.com/jkalucki
Twitter, Inc.
 
On Tue, Sep 7, 2010 at 4:38 AM, omri omridek...@gmail.com
   wrote:
 def run (self):
status_url = 
  http://stream.twitter.com/1/statuses/filter.json;
request = urllib2.Request(status_url)
print request
auth = base64.encodestring('Consumer key:Consumer
   secret')[:-1]
request.add_header('Authorization', 'basic %s' % auth)
firehose = urllib2.urlopen(request)
for tweet in firehose:
print tweet
 
firehose.close
 
 when printing the request i have  500 error, it is not
   reachable.
 
 do you have an idea why?
 
 --
 Twitter developer documentation and resources:
  http://dev.twitter.com/doc
 API updates via Twitter:http://twitter.com/twitterapi
 

Re: [twitter-dev] 401 Unauthorized on status update

2010-09-11 Thread Tom van der Woerdt
Please show your Base String. A lot of issues are related to the Base
String.

Also, to answer your question: yes, you need to combine both secrets.
consumersecretusersecret = your signing key.

Tom


On 9/12/10 12:09 AM, DK wrote:
 I keep getting this when I try to update status. I am using xAuth and
 am able to successfully get access token. MY request:
 
 POST /1/statuses/update.xml HTTP/1.1
 
 Accept: */*
 
 Referer: 
 file:///Applications/Install/8B95EF94-D747-4976-B877-9C0D6F69C000/Install/
 
 Content-Length: 140
 
 Accept-Encoding: identity
 
 Content-Type: application/x-www-form-urlencoded
 
 Authorization: OAuth oauth_nonce=7fa7df55-dff0-498d-
 a412-31f311a58aa2, oauth_signature_method=HMAC-SHA1,
 oauth_timestamp=1284241920,
 oauth_consumer_key=xx,
 oauth_token=185630219-3cz8iKUYxazA9RQyXMSl0WIZK76lJTYlrJ7LZUeR,
 oauth_signature=5F19ANULI0fYZVVCicdbcSTiF2g%3D, oauth_version=1.0
 
 User-Agent: @sebagomez shelltwit
 
 Host: api.twitter.com
 
 Connection: Keep-Alive
 
 Cache-Control: no-cache
 
 
 status=Nothing%20is%20to%20come%2C%20and%20nothing%20past%3A%20But%20an
 %20eternal%20now%2C%20does%20always%20last.%20%0A-%20Abraham%20Cowley
 
 the response i get is:
 
 HTTP/1.1 401 Unauthorized
 
 Date: Sat, 11 Sep 2010 21:52:54 GMT
 
 Server: hi
 
 Status: 401 Unauthorized
 
 WWW-Authenticate: Basic realm=Twitter API
 
 Content-Type: application/xml; charset=utf-8
 
 Content-Length: 135
 
 Cache-Control: no-cache, max-age=1800
 
 Set-Cookie: k=173.79.181.196.1284241973942054; path=/; expires=Sat, 18-
 Sep-10 21:52:53 GMT; domain=.twitter.com
 
 Set-Cookie: guest_id=128424197394768797; path=/; expires=Mon, 11 Oct
 2010 21:52:53 GMT
 
 Set-Cookie:
 original_referer=fBxhJyK4Ko2le28vCjFdUuU0TPqFAtRdqYyfC0jPsNARZDQUgPOC8mBAw3pSUcn9KGWZLCcqP3zbWjCZVfqsrV8qgcG0M3IvAN
 %2FeDqwRZDs%3D; path=/
 
 Set-Cookie:
 _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCMhiyQIrAToHaWQiJTA0NTkyNDA5YWI5ZWRm
 %250ANmEyYTIzZmVlMmI2MGQyODhlIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy
 %250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--048b4c682393f66d9e63abd364abb048db4022cf;
 domain=.twitter.com; path=/
 
 Expires: Sat, 11 Sep 2010 22:22:53 GMT
 
 Vary: Accept-Encoding
 
 Connection: close
 
 
 
 ?xml version=1.0 encoding=UTF-8?
 hash
   request/1/statuses/update.xml/request
   errorIncorrect signature/error
 /hash
 
 
 I am urlencoding the params. Do I need to also include the consumer
 secret in the signature?
 
 Any help is really appreciated as I have spend 2 full days with this :-
 (
 

-- 
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?hl=en


Re: [twitter-dev] update error: Read-only application cannot POST

2010-09-11 Thread Tom van der Woerdt
You need to re-authorize the app. A pair of credentials is either
read/write or readonly, and for security reasons it can't change.

Tom


On 9/12/10 1:22 AM, tomz wrote:
 I've changed my app to Read and Write, but I am still getting the
 following:
 (401): Unauthorized - Read-only application cannot POST
 
 How long does the change take effect?
 
 Thanks,
 Tom Zeng
 t...@intridea.com
 

-- 
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?hl=en


[twitter-dev] Opción para mostrar twitters

2010-09-11 Thread Julio César Méndez
Estimados,

Creo hace falta una opción para activar/desactivar los twitters de las
personas que uno sigue sin que signifique bloquearlo. Es para cuando
uno esta siguiendo a muchas personas poder discriminar cuáles ver en
un determinado momento, y no tener tantos twitters que realmente uno
no puede concentrarse en un tema. Esto es diferente de ver los
twitters de una sola persona de la lista que uno sigue.

Saludos

-- 
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?hl=en


[twitter-dev] Rate Limit Remaining makes no sense

2010-09-11 Thread DaveH
See if this chain of calls and the ratelimit remaining make any
sense...

API callReturned Ratelimit Remaining
Verify Credentials  188
Followers IDs181
Direct Messages   171

The request to verify credentials established that I have 188 calls
left. Since I have been testing this is OK, my max is 350.
The request for followers returned 1 follower and Twitter reduced the
ratelimit by 7.
The request for 10 direct messages, returned ZERO, and my ratelimit is
reduced by 10.

While I was typing this note, I did not perform any API calls. Then,
to see what happens with the calls, I execute the above sequence
again, and this is what I see.

API callReturned Ratelimit Remaining
Verify Credentials  71
Followers IDs52
Direct Messages   39

Now, I would have expected that my application would have had 171
remaining when I ran it again, not 71. It is also strange that it is
100 off. Then the difference between the other API calls is bigger
than the last time I ran to code.

It seems that the rate limit is a bit capricious. I understand that
Twitter says they will reduce based on load, but this is behavior is a
bit strange. This makes no sense to me. Anyone have an idea why the
rate limit would jump around so much?

-- 
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?hl=en