[twitter-dev] Search API: searching for Don and finding don't instead

2010-06-03 Thread Jeffrey Greenberg
We have a user that is causing us to create a search of the form:
   Don SomeLastName
which is returning tweets containing don't and SomeLastName.

Thats a no good!

Is there a decent workaround for this by modifying the search? e.g.
Don SomeLastName -don't
but how do you escape the single quote?  Like this?
Don SomeLastName -don't


[twitter-dev] Re: lang= Support in Search API

2010-06-03 Thread Hwee-Boon Yar
I get my list from http://search.twitter.com/advanced.

--
Hwee-Boon

On Jun 3, 10:21 am, Bess bess...@gmail.com wrote:
 I'd like to confirm the list of language support on Search API b/c I
 couldn't find any documentation in this Google group 
 andhttp://dev.twitter.com.

 From my online search developers say it supports only 3 languages:
 English = en
 Japanese = ja
 Spanish = es

 From documentation, it refers to wikipedia on ISO 63901 code. However,
 I try many lang parameters with many of them not working or returning
 much results.

 http://en.wikipedia.org/wiki/ISO_639-1

 These are listed but not supported:

 *   French is represented by fr
 *   German is represented by de
 *   Portuguese is represented by pt
 *   Haiti is represented by ht or hat

 lang: Optional: Restricts tweets to the given language, given by
 an ISO 639-1 code.

 http://search.twitter.com/search.atom?lang=enq=devohttp://search.twitter.com/search.atom?q=東京大地震locale=ja

 What are the official lang supported? How can we get the latest list?


[twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread byqsri
Can someone give me any suggestion about it?
Many thanks

On 1 Giu, 11:08, byqsri marco.rizze...@gmail.com wrote:
 Hi
 I'm newbie with Twitter API.
 I use OAuth to do authentication.
 Now I have this feature to do : From my web application allow to the
 user to automatically enter on his profile on twitter.
 Is it possible to do this using only the API and using OAuth
 (therefore the account crediantials aren't avaible)?
 Many Thanks


Re: [twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread Lil Peck
On Thu, Jun 3, 2010 at 3:56 AM, byqsri marco.rizze...@gmail.com wrote:
 Can someone give me any suggestion about it?
 Many thanks

 On 1 Giu, 11:08, byqsri marco.rizze...@gmail.com wrote:
 Hi
 I'm newbie with Twitter API.
 I use OAuth to do authentication.
 Now I have this feature to do : From my web application allow to the
 user to automatically enter on his profile on twitter.
 Is it possible to do this using only the API and using OAuth
 (therefore the account crediantials aren't avaible)?
 Many Thanks

Actually, as I understand it, authentication for that purpose would be
necessary only if the user was keeping their account private or
something.

I'm very mindful of this because this is something I've been obsessed
with over the past two days and nights. I've been saving my followers
into a database and remotely saving their avatars for the purpose of
not hitting rate limits.

I've tried lots of stuff and had previously used simplexml heavily,
until within the past couple of hours when I found out how much easier
and faster json is!

Here is an example (use with PHP):
//$f1 is the user id number already in my database, you can do the
same with user name instead
  $api_call = 'http://twitter.com/users/show/'.$f1.'.json';
  $results = json_decode(file_get_contents($api_call));
$profile_image_url= str_replace('_normal', '_mini',
$results-profile_image_url);
$screen_name=($results-screen_name);
$description= ($results-description);
$location=($results-location);
$name= ($results-name);
$followers_count=($results-followers_count);
$friends_count= ($results-friends_count);

--Lil


[twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread byqsri
Sorry , perhaps I have not explained well my problem.
I have done OAuth authentication, I can use Twitter API.
But now I must add a link to my page that if the user click on this
link I redirect to twitter's user profile.
My problem is that if the user is not logged in twitter he has to do
every time the login.
I would ask if there is a way using the Twitter OAuth API to do a
automatic login to Twitter so when user click on the link on my page
he is automatically redirect on his twitter user's profile.



On 3 Giu, 11:10, Lil Peck lilp...@gmail.com wrote:
 On Thu, Jun 3, 2010 at 3:56 AM, byqsri marco.rizze...@gmail.com wrote:
  Can someone give me any suggestion about it?
  Many thanks

  On 1 Giu, 11:08, byqsri marco.rizze...@gmail.com wrote:
  Hi
  I'm newbie with Twitter API.
  I use OAuth to do authentication.
  Now I have this feature to do : From my web application allow to the
  user to automatically enter on his profile on twitter.
  Is it possible to do this using only the API and using OAuth
  (therefore the account crediantials aren't avaible)?
  Many Thanks

 Actually, as I understand it, authentication for that purpose would be
 necessary only if the user was keeping their account private or
 something.

 I'm very mindful of this because this is something I've been obsessed
 with over the past two days and nights. I've been saving my followers
 into a database and remotely saving their avatars for the purpose of
 not hitting rate limits.

 I've tried lots of stuff and had previously used simplexml heavily,
 until within the past couple of hours when I found out how much easier
 and faster json is!

 Here is an example (use with PHP):
 //$f1 is the user id number already in my database, you can do the
 same with user name instead
   $api_call = 'http://twitter.com/users/show/'.$f1.'.json';
   $results = json_decode(file_get_contents($api_call));
 $profile_image_url= str_replace('_normal', '_mini',
 $results-profile_image_url);
 $screen_name=($results-screen_name);
 $description= ($results-description);
 $location=($results-location);
 $name= ($results-name);
 $followers_count=($results-followers_count);
 $friends_count= ($results-friends_count);

 --Lil


[twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread byqsri
Yes , the page where is redirect after login

On 3 Giu, 11:47, Lil Peck lilp...@gmail.com wrote:
 On Thu, Jun 3, 2010 at 4:43 AM, byqsri marco.rizze...@gmail.com wrote:
  Sorry , perhaps I have not explained well my problem.
  I have done OAuth authentication, I can use Twitter API.
  But now I must add a link to my page that if the user click on this
  link I redirect to twitter's user profile.
  My problem is that if the user is not logged in twitter he has to do
  every time the login.
  I would ask if there is a way using the Twitter OAuth API to do a
  automatic login to Twitter so when user click on the link on my page
  he is automatically redirect on his twitter user's profile.

 Do you mean so that he is directed to the private pages of his
 profile rather than he public pages?


[twitter-dev] basic auth deprecation and GFW

2010-06-03 Thread Scott Ballantyne
Hi,

I'm writing to express a little concern about the upcoming deprecation
of basic authentication.  I have developed several twitter api apps
and I understand the great advantages of using oauth for
authentication, but it has one major downfall that makes things
complicated here in china.  That downfall is that you need to actually
go to twitter.com in order to authenticate with the app.  Since
twitter is blocked in china, that is difficult.  Most twitter users in
china likely use an api proxy or some third party software and being
able to use basic auth makes it possible without a vpn to access the
twitter api.

In the same breath, I applaud the recent purchase of tweetie.  It is
the app of choice for people scaling the great firewall on the
iphone.  It has easy options to add an api proxy and it is widely
used.  I hope that with the deprecation of oauth, this app that I once
paid for will not suddenly become unuseable.

I appreciate all of your efforts.

thanks,
scott


[twitter-dev] What is the condition of status is duplicated?

2010-06-03 Thread kimtree

 I have no idea to understand condition of status is duplicated.
 status is duplicated condition is update same tweet in few minutes?
or a day?
 I want to know exact condition.  Have any Ideas?


[twitter-dev] Re: Annotations Hackfest wiki page

2010-06-03 Thread mcintyre321
I would like to second aartiles call for better support. My team had a
screen cast and were ready to do a remote presentation but we couldn't
seem to get the message through (although we tweeted like crazy). Very
very disappointing.

On May 31, 8:43 pm, aartiles aarti...@gmail.com wrote:
 I followed the Hackfest remotely from Spain, I wrote a blog post
 (Spanish) about my thoughts and Hackfest's project (http://e24apps.com/
 pages/annotations.php):

 http://www.bitacoradewebmaster.com/2010/05/31/twitter-annotations-hac...

 I would like a better support for remote attendees in events like
 this.

 Alfredo (@aartiles24)

 On May 31, 10:13 am, Abraham Williams 4bra...@gmail.com wrote:



  For those who could not make it to the Twitter office I snipped the
  introduction from the start and the demoes from the 
  end:http://blog.abrah.am/2010/05/twitter-annotations-hackfest-highlights

  Abraham

  On Sat, May 29, 2010 at 12:32, Ryan Sarver rsar...@twitter.com wrote:
   Here is the page that we'll use to coordinate everything this weekend.
   Let us know if you have any questions.

  https://apiwiki.twitter.com/Annotations-Hackfest-May-25th

   Best, rs

  --
  Abraham Williams | Developer for hire |http://abrah.am
  @abraham |http://projects.abrah.am|http://blog.abrah.am
  This email is: [ ] shareable [x] ask first [ ] private.


[twitter-dev] Re: Yet another Failed to validate oauth signature and token while requesting a token

2010-06-03 Thread craiga
Thanks for the reply Taylor.

So to get a request token, should I send a POST request with no body?
I'm basing my code around the documentation at http://dev.twitter.com/pages/auth
which says:

 Go for the gold. Go for header-based OAuth.

Fair enough. Under Acquiring a request token it also says:

 Twitter's end point for the request token step is 
 http://api.twitter.com/oauth/request_token. You should use the POST HTTP 
 method when using this end point.

Given this, I've changed my request to the following:

POST http://api.twitter.com/oauth/request_token HTTP/1.1
Host: api.twitter.com
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive
Authorization: OAuth oauth_nonce=0628cff78ee32e99ab45c614057c67c4,
oauth_callback=http%3A%2F%2Fcraiga.id.au%2Ftwitter%2Fconnected,
oauth_signature_method=HMAC-SHA1, oauth_timestamp=1275525934,
oauth_consumer_key=tm5...DOg, oauth_signature=LrteVeKYd%2F6QYnKM8kl
%2BswW8GcA%3D, oauth_version=1.0

Still, I'm getting the Failed to validate oauth signature and token.
I've also tried this as a GET request (changing the signature to
reflect the change in method); still no luck.

What am I doing wrong? Am I URL encoding something where I shouldn't
be? Am I not URL encoding something I should be? I'm running ntpdate
to keep the system clock in sync with pool.ntp.org and I've verified
that my nonce is amongst the requests I'm sending.

Any further help would be greatly appreciated.

Thanks,
Craig

On Jun 3, 12:11 am, Taylor Singletary taylorsinglet...@twitter.com
wrote:
 Hi Craig,

 It looks like you are passing oauth_* parameters in your POST body in
 addition to the OAuth HTTP headers. It's really a choice between one or the
 other -- either you send the oauth_* parameters in a HTTP header or you send
 them in either a POST body or querystring.

 When using HTTP header based auth (which I always recommend) the only query
 parameters in a query string or POST body are ones that are directly related
 to the resource your are requesting or posting data to.

 Taylor Singletary
 Developer Advocate, Twitterhttp://twitter.com/episod



 On Tue, Jun 1, 2010 at 9:48 PM, craiga cra...@craiga.id.au wrote:
  Hi guys,

  Sorry for troubling you with yet *another* Failed to validate oauth
  signature and token error, but I just can't figure out what's wrong
  with my request.

  I'm constructing my signature from this string:

  POSThttp%3A%2F%2Fapi.twitter.com%2Foauth
  %2Frequest_tokenoauth_callback%3Dhttp%3A%2F%2Fcraiga.id.au%2Ftwitter
  %2Fconnected%26oauth_consumer_key%3Dtm5...DOg%26oauth_nonce%3D8...22b
  %26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp
  %3D1275453048%26oauth_version%3D1.0

  From this I generate a 28 character signature using the following PHP
  code:

  base64_encode(hash_hmac('sha1', $raw, 'YUo...HIU' . '', true));

  Using this signature, I send the following request:

  POSThttp://api.twitter.com/oauth/request_tokenHTTP/1.1
  Host: api.twitter.com
  Pragma: no-cache
  Accept: */*
  Proxy-Connection: Keep-Alive
  Authorization: OAuth oauth_nonce=3D8...22b, oauth_callback=http%3A
  %2F%2Fcraiga.id.au%2Ftwitter%2Fconnected,
  oauth_signature_method=HMAC-SHA1, oauth_timestamp=1275453048,
  oauth_consumer_key=tm5...DOg, oauth_signature=aYd...c6E%3D,
  oauth_version=1.0
  Content-Length: 266
  Content-Type: application/x-www-form-urlencoded

  oauth_callback=http%3A%2F%2Fcraiga.id.au%2Ftwitter

  %2Fconnectedoauth_consumer_key=tm5...DOgoauth_nonce=3D8...22boauth_signa 
  ture_method=HMAC-
  SHA1oauth_timestamp= 1275453048oauth_version=1.0

  I get the following response from Twitter to this request:

  HTTP/1.1 401 Unauthorized
  Date: Wed, 02 Jun 2010 04:40:14 GMT
  Server: hi
  Status: 401 Unauthorized
  X-Transaction: 1275453614-48409-7443
  Last-Modified: Wed, 02 Jun 2010 04:40:14 GMT
  X-Runtime: 0.01083
  Content-Type: text/html; charset=utf-8
  Content-Length: 44
  Pragma: no-cache
  X-Revision: DEV
  Expires: Tue, 31 Mar 1981 05:00:00 GMT
  Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-
  check=0
  Set-Cookie: k=58.161.42.101.1275453614748615; path=/; expires=Wed, 09-
  Jun-10 04:40:14 GMT; domain=.twitter.com
  Set-Cookie: guest_id=12754536147577949; path=/; expires=Fri, 02 Jul
  2010 04:40:14 GMT
  Set-Cookie:
  _twitter_sess=BAh7CToPY3JlYXRlZF9hdGwrCKaq9fYoAToRdHJhbnNfcHJvbXB0MDoHaWQi
  %250AJWU0ZDFhMGQzMWU0NTZjMzJiZWFkNWUzMTA4ZDRjOTg3IgpmbGFzaElDOidB
  %250AY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--
  f1e5c7649858a1694f24307504354846bbc1d16b; domain=.twitter.com; path=/
  Vary: Accept-Encoding
  Connection: close

  Failed to validate oauth signature and token

  If anyone can cast any light on why this might be failing, I'd love to
  hear.

  Thanks,
  Craig


[twitter-dev] Twitter Infographics Data

2010-06-03 Thread Mo
I'd like to create a series of blog posts that take Twitter
application data from various Twitter apps and converts it into
something visual.  If you have access to data from your own Twitter
app that you are willing to share, and that you think can reflect a
major trend in the Twitter ecosphere, or that you've already built an
infographic/chart/graph/visualizatoin for, please let me know.

The first post in the series is 18 Tittilating Twitter Infographics
and Visualizations.  You can find it at
http://blog.pay4tweet.com/2010/06/02/18-tittilating-twitter-infographics-and-visualizations/

Thanks.

-Mo
@pay4tweet


[twitter-dev] OAuth Echo problem in python

2010-06-03 Thread yml
Hello,
I am in the process of writing a python web app that should enable the
user to post picture to twitpic using the Oauth Echo authorization
mechanism.

The application is already able to post tweet using the Oauth
authentication so the access_token is available to us in the session.

So my question to you guys is that it would be great if someone could
point what is the issue in the code below or paste some sample code
that upload a picture in python to twitpic.




# OauthRequest is from the python-oauth lib
# I overide the to_header method to return a dict with the right key.

class TwitpicOAuthRequest(OAuthRequest):
def to_header(self, realm='http://api.twitter.com/'):
headers = super(TwitpicOAuthRequest,
self).to_header(realm=realm)
return {'X-Verify-Credentials-Authorization':
headers['Authorization']}

def post_photo(request):
if request.method == 'POST':
form = PhotoForm(request.POST, request.FILES)
if not request.session.get('twitter_access_token'):
return HttpResponse(Not authenticated)
if form.is_valid():
access_token = request.session['twitter_access_token']

params = {
'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
'oauth_signature_method':HMAC-SHA1,
'oauth_token':access_token.key,
'oauth_timestamp':oauth.generate_timestamp(),
'oauth_nonce':oauth.generate_nonce(),
'oauth_version':'1.0'
}

consumer =
oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
secret=settings.TWITTER_CONSUMER_SECRET)
token = oauth.OAuthToken(key=access_token.key,
 secret=access_token.secret)
oauth_request = TwitpicOAuthRequest(http_method=POST,
 
http_url=settings.TWITPIC_API_URL,
  parameters=params)
 
signature=oauth_request.build_signature(OAuthSignatureMethod_HMAC_SHA1(),
consumer,
access_token)

headers = oauth_request.to_header()
headers['X-Auth-Service-Provider'] = 'https://
api.twitter.com/1/account/verify_credentials.json'
headers['X-Verify-Credentials-Authorization'] += ',
oauth_signature=%s' %signature

values = {}
values['key'] = settings.TWITPIC_API_KEY
values['message'] = form.cleaned_data['message']
# the path to the file is hardcoded here in the future it
will be taken from the from
values['media'] = open(/home/yml/Desktop/copine_moi.jpg,
rb)
register_openers()
datagen, heads = multipart_encode(values)
headers.update(heads)

req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
headers)
response = urllib2.urlopen(req)

return HttpResponse(the photo is posted)
else:
form = PhotoForm(initial={created_at:datetime.now()})

return render_to_response(twitter_integration/photo_form.html,
  {form:form,},
 
context_instance=RequestContext(request))



Re: [twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread Taylor Singletary
As far as an application is concerned, the logged in/logged out state of the
Twitter user is immaterial. The REST API is stateless and does not pertain
to a session state. Your application should have no concern about the logged
in status of a user. Landing on a Twitter profile URL does not require a
login, regardless of the protected attribute of the Twitter user. If the
user is logged out and lands on a protected user's page, they will still see
an abbreviated version of the page, noting that the user has protected their
tweets. If the user is unprotected, they get a standard logged-out version
of the profile page.

Taylor Singletary
Developer Advocate, Twitter
http://twitter.com/episod


On Thu, Jun 3, 2010 at 2:54 AM, byqsri marco.rizze...@gmail.com wrote:

 Yes , the page where is redirect after login

 On 3 Giu, 11:47, Lil Peck lilp...@gmail.com wrote:
  On Thu, Jun 3, 2010 at 4:43 AM, byqsri marco.rizze...@gmail.com wrote:
   Sorry , perhaps I have not explained well my problem.
   I have done OAuth authentication, I can use Twitter API.
   But now I must add a link to my page that if the user click on this
   link I redirect to twitter's user profile.
   My problem is that if the user is not logged in twitter he has to do
   every time the login.
   I would ask if there is a way using the Twitter OAuth API to do a
   automatic login to Twitter so when user click on the link on my page
   he is automatically redirect on his twitter user's profile.
 
  Do you mean so that he is directed to the private pages of his
  profile rather than he public pages?



Re: [twitter-dev] What is the condition of status is duplicated?

2010-06-03 Thread Taylor Singletary
We tune the duplicate tweet detection algorithm regularly, so it's difficult
to say with any hard rules at what point a tweet will be considered a
duplicate -- it's not necessarily time-based and more tuned toward the
contents of the last few tweets issued by the user account. If you're use
case is such that you'd be issuing the same tweet multiple times, you might
want to provide some kind of unique string to each tweet, or otherwise
insure that the tweet is not a duplicate.

Taylor Singletary
Developer Advocate, Twitter
http://twitter.com/episod


On Thu, Jun 3, 2010 at 12:10 AM, kimtree i...@kimtree.net wrote:


  I have no idea to understand condition of status is duplicated.
  status is duplicated condition is update same tweet in few minutes?
 or a day?
  I want to know exact condition.  Have any Ideas?



[twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread byqsri
My question is another.
Substantially I would know if is it possible to do an automatic login
to twitter only using OAuth API and withouth know account crediantials
of the user.

 On 3 Giu, 17:55, Taylor Singletary taylorsinglet...@twitter.com wrote:
 As far as an application is concerned, the logged in/logged out state of the
 Twitter user is immaterial. The REST API is stateless and does not pertain
 to a session state. Your application should have no concern about the logged
 in status of a user. Landing on a Twitter profile URL does not require a
 login, regardless of the protected attribute of the Twitter user. If the
 user is logged out and lands on a protected user's page, they will still see
 an abbreviated version of the page, noting that the user has protected their
 tweets. If the user is unprotected, they get a standard logged-out version
 of the profile page.

 Taylor Singletary
 Developer Advocate, Twitterhttp://twitter.com/episod



 On Thu, Jun 3, 2010 at 2:54 AM, byqsri marco.rizze...@gmail.com wrote:
  Yes , the page where is redirect after login

  On 3 Giu, 11:47, Lil Peck lilp...@gmail.com wrote:
   On Thu, Jun 3, 2010 at 4:43 AM, byqsri marco.rizze...@gmail.com wrote:
Sorry , perhaps I have not explained well my problem.
I have done OAuth authentication, I can use Twitter API.
But now I must add a link to my page that if the user click on this
link I redirect to twitter's user profile.
My problem is that if the user is not logged in twitter he has to do
every time the login.
I would ask if there is a way using the Twitter OAuth API to do a
automatic login to Twitter so when user click on the link on my page
he is automatically redirect on his twitter user's profile.

   Do you mean so that he is directed to the private pages of his
   profile rather than he public pages?- Nascondi testo citato

 - Mostra testo citato -


[twitter-dev] Re: Sorry, your query is too complex. Please reduce complexity and try again.

2010-06-03 Thread Dewald Pretorius
How can this query be too complex?

http://search.twitter.com/search?q=%22for+sale+by+owner%22+near:%22fort+worth%22+within:100mi

It's a very simple geo-targeted query.

Has Search suffered a frontal lobotomy? These searches used to work
before.

On May 24, 2:32 am, Cameron Kaiser spec...@floodgap.com wrote:
  I keep getting the message:  Sorry, yourqueryistoocomplex. Please
  reduce complexity and try again.

  Is there a way around this?

 Post yourquery, perhaps?

 In general, no. You might have to combine two less complicated searches into
 a single set on your end rather than expecting the Search API to do it.

 --
  personal:http://www.cameronkaiser.com/--
   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
 -- Backup not found. Abort, Retry, Vomit, Panic, Write Resume File? 
 ---


[twitter-dev] xAuth Unsupported URL Error

2010-06-03 Thread Craig Hanson
Hello,

I recently received authorization from Twitter to use xAuth for
authentication on an iphone application. I am using the POST method as
described in the docs for xAuth, however, everytime I make my
NSMutableURLRequest I get an 'unsupported url' error. The url I'm using the
post to looks like this:

https%3A%2F%2Fapi.twitter.com%2Foauth%2Faccess_token

I am using the following authorization header:
OAuth oauth_nonce=EBE7DF5A-0B88-4455-92F3-FCD6AEA3B297,
oauth_signature_method=HMAC-SHA1, oauth_timestamp=1275580859,
oauth_consumer_key=myconsumerkey, oauth_signature=mysignature%3D,
oauth_version=1.0

The post body looks like this:
x_auth_mode=client_authx_auth_password=passwordx_auth_username=username

Are there any ideas as to what could be going wrong? It seems no matter what
I do, the NSURLConnection fails immediately with this unsupported url error:

NSErrorFailingURLKey = https%3A%2F%2Fapi.twitter.com%2Foauth%2Faccess_token;
NSErrorFailingURLStringKey = https%3A%2F%2Fapi.twitter.com
%2Foauth%2Faccess_token;
NSLocalizedDescription = unsupported URL;
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork Code=-1002
UserInfo=0x3f5d230 unsupported URL;

Thanks!
Craig


Re: [twitter-dev] Re: Redirect to user's profile page via API

2010-06-03 Thread Abraham Williams
If you are asking if you can login a user into the twitter.com website using
your applications oauth credentials the answer is no. They only way for a
user to authenticate with the twitter.com website is by giving their
password to twitter.com

Abraham

On Thu, Jun 3, 2010 at 09:34, byqsri marco.rizze...@gmail.com wrote:

 My question is another.
 Substantially I would know if is it possible to do an automatic login
 to twitter only using OAuth API and withouth know account crediantials
 of the user.

  On 3 Giu, 17:55, Taylor Singletary taylorsinglet...@twitter.com wrote:
  As far as an application is concerned, the logged in/logged out state of
 the
  Twitter user is immaterial. The REST API is stateless and does not
 pertain
  to a session state. Your application should have no concern about the
 logged
  in status of a user. Landing on a Twitter profile URL does not require a
  login, regardless of the protected attribute of the Twitter user. If the
  user is logged out and lands on a protected user's page, they will still
 see
  an abbreviated version of the page, noting that the user has protected
 their
  tweets. If the user is unprotected, they get a standard logged-out
 version
  of the profile page.
 
  Taylor Singletary
  Developer Advocate, Twitterhttp://twitter.com/episod
 
 
 
  On Thu, Jun 3, 2010 at 2:54 AM, byqsri marco.rizze...@gmail.com wrote:
   Yes , the page where is redirect after login
 
   On 3 Giu, 11:47, Lil Peck lilp...@gmail.com wrote:
On Thu, Jun 3, 2010 at 4:43 AM, byqsri marco.rizze...@gmail.com
 wrote:
 Sorry , perhaps I have not explained well my problem.
 I have done OAuth authentication, I can use Twitter API.
 But now I must add a link to my page that if the user click on this
 link I redirect to twitter's user profile.
 My problem is that if the user is not logged in twitter he has to
 do
 every time the login.
 I would ask if there is a way using the Twitter OAuth API to do a
 automatic login to Twitter so when user click on the link on my
 page
 he is automatically redirect on his twitter user's profile.
 
Do you mean so that he is directed to the private pages of his
profile rather than he public pages?- Nascondi testo citato
 
  - Mostra testo citato -




-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.


[twitter-dev] You both follow feature

2010-06-03 Thread Rich
Hi

I've just read about a new Twitter feature coming called 'you both
follow'. Are there any plans for an api endpoint for this?

Richard


Re: [twitter-dev] You both follow feature

2010-06-03 Thread Abraham Williams
You can always use my Intersect API too: http://github.com/abraham/intersect

Abraham

On Thu, Jun 3, 2010 at 10:18, Rich rhyl...@gmail.com wrote:

 Hi

 I've just read about a new Twitter feature coming called 'you both
 follow'. Are there any plans for an api endpoint for this?

 Richard




-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.


Re: [twitter-dev] Twitter Infographics Data

2010-06-03 Thread Abraham Williams
Nice collection of infographics.

Abraham

On Thu, Jun 3, 2010 at 07:43, Mo maur...@moluv.com wrote:

 I'd like to create a series of blog posts that take Twitter
 application data from various Twitter apps and converts it into
 something visual.  If you have access to data from your own Twitter
 app that you are willing to share, and that you think can reflect a
 major trend in the Twitter ecosphere, or that you've already built an
 infographic/chart/graph/visualizatoin for, please let me know.

 The first post in the series is 18 Tittilating Twitter Infographics
 and Visualizations.  You can find it at

 http://blog.pay4tweet.com/2010/06/02/18-tittilating-twitter-infographics-and-visualizations/

 Thanks.

 -Mo
 @pay4tweet




-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.


[twitter-dev] Re: What is the condition of status is duplicated?

2010-06-03 Thread Dewald Pretorius
Taylor,

I don't understand. Why would Twitter on the one hand do duplicate
checking and on the other hand advise people to add some kind of
unique string to the tweet to circumvent the duplicate checking?
You're basically saying it's okay for an application to automatically
add a randomly generated string of nonsense to each tweet, to ensure
it is unique and will thwart Twitter's duplication content prevention
measures.

Isn't that a perfect exercise in self-defeat, or what the military
folks call chickenshit?

On Jun 3, 12:49 pm, Taylor Singletary taylorsinglet...@twitter.com
wrote:
 We tune the duplicate tweet detection algorithm regularly, so it's difficult
 to say with any hard rules at what point a tweet will be considered a
 duplicate -- it's not necessarily time-based and more tuned toward the
 contents of the last few tweets issued by the user account. If you're use
 case is such that you'd be issuing the same tweet multiple times, you might
 want to provide some kind of unique string to each tweet, or otherwise
 insure that the tweet is not a duplicate.

 Taylor Singletary
 Developer Advocate, Twitterhttp://twitter.com/episod



 On Thu, Jun 3, 2010 at 12:10 AM, kimtree i...@kimtree.net wrote:

   I have no idea to understand condition of status is duplicated.
   status is duplicated condition is update same tweet in few minutes?
  or a day?
   I want to know exact condition.  Have any Ideas?


Re: [twitter-dev] What is the condition of status is duplicated?

2010-06-03 Thread Taylor Singletary
People use Twitter differently. Duplicate prevention is mainly a
protection for standard user use cases and spam protection. There is
value in programmatic use of Twitter that is outside of typical user
experiences, and there are corner cases where duplicate tweets can be
useful.  I'm not here to tell you how to use Twitter.

On Thursday, June 3, 2010, Dewald Pretorius dpr...@gmail.com wrote:
 Taylor,

 I don't understand. Why would Twitter on the one hand do duplicate
 checking and on the other hand advise people to add some kind of
 unique string to the tweet to circumvent the duplicate checking?
 You're basically saying it's okay for an application to automatically
 add a randomly generated string of nonsense to each tweet, to ensure
 it is unique and will thwart Twitter's duplication content prevention
 measures.

 Isn't that a perfect exercise in self-defeat, or what the military
 folks call chickenshit?

 On Jun 3, 12:49 pm, Taylor Singletary taylorsinglet...@twitter.com
 wrote:
 We tune the duplicate tweet detection algorithm regularly, so it's difficult
 to say with any hard rules at what point a tweet will be considered a
 duplicate -- it's not necessarily time-based and more tuned toward the
 contents of the last few tweets issued by the user account. If you're use
 case is such that you'd be issuing the same tweet multiple times, you might
 want to provide some kind of unique string to each tweet, or otherwise
 insure that the tweet is not a duplicate.

 Taylor Singletary
 Developer Advocate, Twitterhttp://twitter.com/episod



 On Thu, Jun 3, 2010 at 12:10 AM, kimtree i...@kimtree.net wrote:

   I have no idea to understand condition of status is duplicated.
   status is duplicated condition is update same tweet in few minutes?
  or a day?
   I want to know exact condition.  Have any Ideas?


-- 
Taylor Singletary
Developer Advocate, Twitter
http://twitter.com/episod


Re: [twitter-dev] Re: Get user profile pic by name, unauthenticated?

2010-06-03 Thread Lil Peck
On Sun, Apr 18, 2010 at 3:37 PM, Raffi Krikorian ra...@twitter.com wrote:
 http://api.twitter.com/1/users/profile_image/raffi?size=bigger
 we will document this endpoint this week.


Revisiting this topic because after trying various solutions for
retrieving and saving followers' avatars, I finally stumbled onto this
topic (when the topic was new I didn't know it would be important to
me later, lol) and found that Raffi's post, combined with this:

http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl

grabs the avatars more expediently than anything else I've tried.

BTW--just want to say how much I enjoy participating in this
community. I'm often a bit wary of posting for fear of looking stupid,
but perhaps if I occasionally make myself look really clueless, then
it gives courage to others who may be equally cautious, but will see
that they couldn't possibly look more clueless than moi.

Thanks to the Twitter development team and to everyone else here who
shares. It isn't just about getting things done, it is about the fun
of a shared interest, and the excitement of being part of something
important.

Lil


[twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread yml
I would greatly appreciate any help.
Here it is the latest evolution of this piece of code :



class TwitpicOAuthRequest(OAuthRequest):
def to_header(self, realm='http://api.twitter.com/'):
headers = super(TwitpicOAuthRequest,
self).to_header(realm=realm)
return {'X-Verify-Credentials-Authorization':
headers['Authorization']}

def post_photo(request):
if request.method == 'POST':
form = PhotoForm(request.POST, request.FILES)
if not request.session.get('twitter_access_token'):
return HttpResponse(Not authenticated)
if form.is_valid():
access_token = request.session['twitter_access_token']

params = {
'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
'oauth_signature_method':HMAC-SHA1,
'oauth_token':access_token.key,
'oauth_timestamp':oauth.generate_timestamp(),
'oauth_nonce':oauth.generate_nonce(),
'oauth_version':'1.0'
}

consumer =
oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
secret=settings.TWITTER_CONSUMER_SECRET)
token = oauth.OAuthToken(key=access_token.key,
 secret=access_token.secret)
oauth_request = TwitpicOAuthRequest(http_method=GET,
 
#http_url=settings.TWITPIC_API_URL,
 
http_url=settings.TWITTER_VERIFY_CREDENTIALS,
  parameters=params)
 
signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
consumer,
access_token)

headers = oauth_request.to_header()
headers['X-Auth-Service-Provider'] =
settings.TWITTER_VERIFY_CREDENTIALS


#with multipart_encode
values = [
MultipartParam('key',value=settings.TWITPIC_API_KEY),
 
MultipartParam('message',value=form.cleaned_data['message']),
MultipartParam('media',
   filename='copine_moi.jpg',
   filetype='image/jpeg',
   fileobj=open(/home/yml/Desktop/
copine_moi.jpg,rb))
]

register_openers()
datagen, heads = multipart_encode(values)
headers.update(heads)
req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
headers)
# Post to netcat -l -p 9000
#req = urllib2.Request(http://127.0.0.1:9000;, datagen,
headers)

#with urlencode
#values = {}
#values['key'] = MultipartParam(settings.TWITPIC_API_KEY)
#values['message'] =
MultipartParam(form.cleaned_data['message'])
#values['media'] = open(/home/yml/Desktop/
copine_moi.jpg, rb).read()
#data = urllib.urlencode(values)
#req = urllib2.Request(settings.TWITPIC_API_URL, data,
headers)

response = urllib2.urlopen(req)
return HttpResponse(the photo is posted)
else:
form = PhotoForm(initial={created_at:datetime.now()})

return render_to_response(twitter_integration/photo_form.html,
  {form:form,},
 
context_instance=RequestContext(request))



On Jun 3, 11:20 am, yml yann.ma...@gmail.com wrote:
 Hello,
 I am in the process of writing a python web app that should enable the
 user to post picture to twitpic using the Oauth Echo authorization
 mechanism.

 The application is already able to post tweet using the Oauth
 authentication so the access_token is available to us in the session.

 So my question to you guys is that it would be great if someone could
 point what is the issue in the code below or paste some sample code
 that upload a picture in python to twitpic.

 
 # OauthRequest is from the python-oauth lib
 # I overide the to_header method to return a dict with the right key.

 class TwitpicOAuthRequest(OAuthRequest):
     def to_header(self, realm='http://api.twitter.com/'):
         headers = super(TwitpicOAuthRequest,
 self).to_header(realm=realm)
         return {'X-Verify-Credentials-Authorization':
 headers['Authorization']}

 def post_photo(request):
     if request.method == 'POST':
         form = PhotoForm(request.POST, request.FILES)
         if not request.session.get('twitter_access_token'):
             return HttpResponse(Not authenticated)
         if form.is_valid():
             access_token = request.session['twitter_access_token']

             params = {
                 'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
                 'oauth_signature_method':HMAC-SHA1,
                 'oauth_token':access_token.key,
                 'oauth_timestamp':oauth.generate_timestamp(),
                 'oauth_nonce':oauth.generate_nonce(),
                 'oauth_version':'1.0'
             }

             consumer =
 oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,

 secret=settings.TWITTER_CONSUMER_SECRET)
             token = 

[twitter-dev] Re: What is the condition of status is duplicated?

2010-06-03 Thread Dewald Pretorius
Taylor,

It's about creating confusion and uncertainty.

Is Twitter not going to suspend a user or an application that
generates duplicate content, and appends a randomly generated string
of nonsense to each tweet to thwart your duplicate prevention
measures?

I see this notion of we don't want to tell you how to use Twitter
more and more. It also came to out of the advertisement banning thing
the other day.

In principle it is good. But, to what extent is Twitter really serious
about that? Every one of the Twitter rules tells me and everyone else
how we must and mustn't use Twitter.

On Jun 3, 2:54 pm, Taylor Singletary taylorsinglet...@twitter.com
wrote:
 People use Twitter differently. Duplicate prevention is mainly a
 protection for standard user use cases and spam protection. There is
 value in programmatic use of Twitter that is outside of typical user
 experiences, and there are corner cases where duplicate tweets can be
 useful.  I'm not here to tell you how to use Twitter.





 On Thursday, June 3, 2010, Dewald Pretorius dpr...@gmail.com wrote:
  Taylor,

  I don't understand. Why would Twitter on the one hand do duplicate
  checking and on the other hand advise people to add some kind of
  unique string to the tweet to circumvent the duplicate checking?
  You're basically saying it's okay for an application to automatically
  add a randomly generated string of nonsense to each tweet, to ensure
  it is unique and will thwart Twitter's duplication content prevention
  measures.

  Isn't that a perfect exercise in self-defeat, or what the military
  folks call chickenshit?

  On Jun 3, 12:49 pm, Taylor Singletary taylorsinglet...@twitter.com
  wrote:
  We tune the duplicate tweet detection algorithm regularly, so it's 
  difficult
  to say with any hard rules at what point a tweet will be considered a
  duplicate -- it's not necessarily time-based and more tuned toward the
  contents of the last few tweets issued by the user account. If you're use
  case is such that you'd be issuing the same tweet multiple times, you might
  want to provide some kind of unique string to each tweet, or otherwise
  insure that the tweet is not a duplicate.

  Taylor Singletary
  Developer Advocate, Twitterhttp://twitter.com/episod

  On Thu, Jun 3, 2010 at 12:10 AM, kimtree i...@kimtree.net wrote:

    I have no idea to understand condition of status is duplicated.
    status is duplicated condition is update same tweet in few minutes?
   or a day?
    I want to know exact condition.  Have any Ideas?

 --
 Taylor Singletary
 Developer Advocate, Twitterhttp://twitter.com/episod


[twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Steve C
I just looked at your code briefly, but I believe the problem is this
line:

oauth_request = TwitpicOAuthRequest(http_method=POST,
http_url=settings.TWITPIC_API_URL,

The OAuth Request needs to be signed using the Twitter Endpoint
(https://api.twitter.com/1/account/verify_credentials.json), not the
Twitpic API URL.

Try something like this:

oauth_request = TwitpicOAuthRequest(http_method=GET,
http_url=https://api.twitter.com/1/account/verify_credentials.json;,


On Jun 3, 2:38 pm, yml yann.ma...@gmail.com wrote:
 I would greatly appreciate any help.
 Here it is the latest evolution of this piece of code :

 
 class TwitpicOAuthRequest(OAuthRequest):
     def to_header(self, realm='http://api.twitter.com/'):
         headers = super(TwitpicOAuthRequest,
 self).to_header(realm=realm)
         return {'X-Verify-Credentials-Authorization':
 headers['Authorization']}

 def post_photo(request):
     if request.method == 'POST':
         form = PhotoForm(request.POST, request.FILES)
         if not request.session.get('twitter_access_token'):
             return HttpResponse(Not authenticated)
         if form.is_valid():
             access_token = request.session['twitter_access_token']

             params = {
                 'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
                 'oauth_signature_method':HMAC-SHA1,
                 'oauth_token':access_token.key,
                 'oauth_timestamp':oauth.generate_timestamp(),
                 'oauth_nonce':oauth.generate_nonce(),
                 'oauth_version':'1.0'
             }

             consumer =
 oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,

 secret=settings.TWITTER_CONSUMER_SECRET)
             token = oauth.OAuthToken(key=access_token.key,
                                      secret=access_token.secret)
             oauth_request = TwitpicOAuthRequest(http_method=GET,

 #http_url=settings.TWITPIC_API_URL,

 http_url=settings.TWITTER_VERIFY_CREDENTIALS,
                                           parameters=params)

 signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
 consumer,
                                     access_token)

             headers = oauth_request.to_header()
             headers['X-Auth-Service-Provider'] =
 settings.TWITTER_VERIFY_CREDENTIALS

             #with multipart_encode
             values = [
                 MultipartParam('key',value=settings.TWITPIC_API_KEY),

 MultipartParam('message',value=form.cleaned_data['message']),
                 MultipartParam('media',
                                filename='copine_moi.jpg',
                                filetype='image/jpeg',
                                fileobj=open(/home/yml/Desktop/
 copine_moi.jpg,rb))
             ]

             register_openers()
             datagen, heads = multipart_encode(values)
             headers.update(heads)
             req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
 headers)
             # Post to netcat -l -p 9000
             #req = urllib2.Request(http://127.0.0.1:9000;, datagen,
 headers)

             #with urlencode
             #values = {}
             #values['key'] = MultipartParam(settings.TWITPIC_API_KEY)
             #values['message'] =
 MultipartParam(form.cleaned_data['message'])
             #values['media'] = open(/home/yml/Desktop/
 copine_moi.jpg, rb).read()
             #data = urllib.urlencode(values)
             #req = urllib2.Request(settings.TWITPIC_API_URL, data,
 headers)

             response = urllib2.urlopen(req)
             return HttpResponse(the photo is posted)
     else:
         form = PhotoForm(initial={created_at:datetime.now()})

     return render_to_response(twitter_integration/photo_form.html,
                               {form:form,},

 context_instance=RequestContext(request))
 

 On Jun 3, 11:20 am, yml yann.ma...@gmail.com wrote:



  Hello,
  I am in the process of writing a python web app that should enable the
  user to post picture to twitpic using the Oauth Echo authorization
  mechanism.

  The application is already able to post tweet using the Oauth
  authentication so the access_token is available to us in the session.

  So my question to you guys is that it would be great if someone could
  point what is the issue in the code below or paste some sample code
  that upload a picture in python to twitpic.

  
  # OauthRequest is from the python-oauth lib
  # I overide the to_header method to return a dict with the right key.

  class TwitpicOAuthRequest(OAuthRequest):
      def to_header(self, realm='http://api.twitter.com/'):
          headers = super(TwitpicOAuthRequest,
  self).to_header(realm=realm)
          return {'X-Verify-Credentials-Authorization':
  headers['Authorization']}

  def post_photo(request):
      if request.method == 'POST':
          form = PhotoForm(request.POST, request.FILES)
          if not request.session.get('twitter_access_token'):
              return HttpResponse(Not authenticated)

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Yann Malet
Thanks Steve for your reply but has you could see in the second code snippet
I have posted i have changed this from POST to GET without much success.

I had also replaced the http_url has you suggest.

One of my question is how does the file should be sent in the  ?
multipart_encode or urlencode

I would be glad to provide you with any additional information if you need
it.
Regards,
--yml


On Thu, Jun 3, 2010 at 6:15 PM, Steve C st...@twitpic.com wrote:

 I just looked at your code briefly, but I believe the problem is this
 line:

 oauth_request = TwitpicOAuthRequest(http_method=POST,
 http_url=settings.TWITPIC_API_URL,

 The OAuth Request needs to be signed using the Twitter Endpoint
 (https://api.twitter.com/1/account/verify_credentials.json), not the
 Twitpic API URL.

 Try something like this:

 oauth_request = TwitpicOAuthRequest(http_method=GET,
 http_url=https://api.twitter.com/1/account/verify_credentials.json;,


 On Jun 3, 2:38 pm, yml yann.ma...@gmail.com wrote:
  I would greatly appreciate any help.
  Here it is the latest evolution of this piece of code :
 
  
  class TwitpicOAuthRequest(OAuthRequest):
  def to_header(self, realm='http://api.twitter.com/'):
  headers = super(TwitpicOAuthRequest,
  self).to_header(realm=realm)
  return {'X-Verify-Credentials-Authorization':
  headers['Authorization']}
 
  def post_photo(request):
  if request.method == 'POST':
  form = PhotoForm(request.POST, request.FILES)
  if not request.session.get('twitter_access_token'):
  return HttpResponse(Not authenticated)
  if form.is_valid():
  access_token = request.session['twitter_access_token']
 
  params = {
  'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
  'oauth_signature_method':HMAC-SHA1,
  'oauth_token':access_token.key,
  'oauth_timestamp':oauth.generate_timestamp(),
  'oauth_nonce':oauth.generate_nonce(),
  'oauth_version':'1.0'
  }
 
  consumer =
  oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
  secret=settings.TWITTER_CONSUMER_SECRET)
  token = oauth.OAuthToken(key=access_token.key,
   secret=access_token.secret)
  oauth_request = TwitpicOAuthRequest(http_method=GET,
 
  #http_url=settings.TWITPIC_API_URL,
 
  http_url=settings.TWITTER_VERIFY_CREDENTIALS,
parameters=params)
 
  signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
  consumer,
  access_token)
 
  headers = oauth_request.to_header()
  headers['X-Auth-Service-Provider'] =
  settings.TWITTER_VERIFY_CREDENTIALS
 
  #with multipart_encode
  values = [
  MultipartParam('key',value=settings.TWITPIC_API_KEY),
 
  MultipartParam('message',value=form.cleaned_data['message']),
  MultipartParam('media',
 filename='copine_moi.jpg',
 filetype='image/jpeg',
 fileobj=open(/home/yml/Desktop/
  copine_moi.jpg,rb))
  ]
 
  register_openers()
  datagen, heads = multipart_encode(values)
  headers.update(heads)
  req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
  headers)
  # Post to netcat -l -p 9000
  #req = urllib2.Request(http://127.0.0.1:9000;, datagen,
  headers)
 
  #with urlencode
  #values = {}
  #values['key'] = MultipartParam(settings.TWITPIC_API_KEY)
  #values['message'] =
  MultipartParam(form.cleaned_data['message'])
  #values['media'] = open(/home/yml/Desktop/
  copine_moi.jpg, rb).read()
  #data = urllib.urlencode(values)
  #req = urllib2.Request(settings.TWITPIC_API_URL, data,
  headers)
 
  response = urllib2.urlopen(req)
  return HttpResponse(the photo is posted)
  else:
  form = PhotoForm(initial={created_at:datetime.now()})
 
  return render_to_response(twitter_integration/photo_form.html,
{form:form,},
 
  context_instance=RequestContext(request))
  
 
  On Jun 3, 11:20 am, yml yann.ma...@gmail.com wrote:
 
 
 
   Hello,
   I am in the process of writing a python web app that should enable the
   user to post picture to twitpic using the Oauth Echo authorization
   mechanism.
 
   The application is already able to post tweet using the Oauth
   authentication so the access_token is available to us in the session.
 
   So my question to you guys is that it would be great if someone could
   point what is the issue in the code below or paste some sample code
   that upload a picture in python to twitpic.
 
   
   # OauthRequest is from the 

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Zac Bowling
It may not help fix your problem but I would recommend upgrading to the 
python-oauth2 library. (Don't be confused by the name; it's not an oauth 2.0 
library, but just the next generation of the original oauth 1.0a library that 
Leah Culver wrote). There are bunch of little issues with the original one that 
don't follow the spec exactly that are fixed and it's not a difficult upgrade 
(as long as your are not hosting an OAuth server of your own because those 
interfaces changed considerably). 

http://github.com/zbowling/python-oauth2 (the fork I maintain with bunch of 
twitter related fixes and workarounds)
or:
http://github.com/simplegeo/python-oauth2 (the official upstream) 

Zac Bowling
@zbowling

On Jun 3, 2010, at 3:15 PM, Steve C wrote:

 I just looked at your code briefly, but I believe the problem is this
 line:
 
 oauth_request = TwitpicOAuthRequest(http_method=POST,
 http_url=settings.TWITPIC_API_URL,
 
 The OAuth Request needs to be signed using the Twitter Endpoint
 (https://api.twitter.com/1/account/verify_credentials.json), not the
 Twitpic API URL.
 
 Try something like this:
 
 oauth_request = TwitpicOAuthRequest(http_method=GET,
 http_url=https://api.twitter.com/1/account/verify_credentials.json;,
 
 
 On Jun 3, 2:38 pm, yml yann.ma...@gmail.com wrote:
 I would greatly appreciate any help.
 Here it is the latest evolution of this piece of code :
 
 
 class TwitpicOAuthRequest(OAuthRequest):
 def to_header(self, realm='http://api.twitter.com/'):
 headers = super(TwitpicOAuthRequest,
 self).to_header(realm=realm)
 return {'X-Verify-Credentials-Authorization':
 headers['Authorization']}
 
 def post_photo(request):
 if request.method == 'POST':
 form = PhotoForm(request.POST, request.FILES)
 if not request.session.get('twitter_access_token'):
 return HttpResponse(Not authenticated)
 if form.is_valid():
 access_token = request.session['twitter_access_token']
 
 params = {
 'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
 'oauth_signature_method':HMAC-SHA1,
 'oauth_token':access_token.key,
 'oauth_timestamp':oauth.generate_timestamp(),
 'oauth_nonce':oauth.generate_nonce(),
 'oauth_version':'1.0'
 }
 
 consumer =
 oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
 secret=settings.TWITTER_CONSUMER_SECRET)
 token = oauth.OAuthToken(key=access_token.key,
  secret=access_token.secret)
 oauth_request = TwitpicOAuthRequest(http_method=GET,
 
 #http_url=settings.TWITPIC_API_URL,
 
 http_url=settings.TWITTER_VERIFY_CREDENTIALS,
   parameters=params)
 
 signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
 consumer,
 access_token)
 
 headers = oauth_request.to_header()
 headers['X-Auth-Service-Provider'] =
 settings.TWITTER_VERIFY_CREDENTIALS
 
 #with multipart_encode
 values = [
 MultipartParam('key',value=settings.TWITPIC_API_KEY),
 
 MultipartParam('message',value=form.cleaned_data['message']),
 MultipartParam('media',
filename='copine_moi.jpg',
filetype='image/jpeg',
fileobj=open(/home/yml/Desktop/
 copine_moi.jpg,rb))
 ]
 
 register_openers()
 datagen, heads = multipart_encode(values)
 headers.update(heads)
 req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
 headers)
 # Post to netcat -l -p 9000
 #req = urllib2.Request(http://127.0.0.1:9000;, datagen,
 headers)
 
 #with urlencode
 #values = {}
 #values['key'] = MultipartParam(settings.TWITPIC_API_KEY)
 #values['message'] =
 MultipartParam(form.cleaned_data['message'])
 #values['media'] = open(/home/yml/Desktop/
 copine_moi.jpg, rb).read()
 #data = urllib.urlencode(values)
 #req = urllib2.Request(settings.TWITPIC_API_URL, data,
 headers)
 
 response = urllib2.urlopen(req)
 return HttpResponse(the photo is posted)
 else:
 form = PhotoForm(initial={created_at:datetime.now()})
 
 return render_to_response(twitter_integration/photo_form.html,
   {form:form,},
 
 context_instance=RequestContext(request))
 
 
 On Jun 3, 11:20 am, yml yann.ma...@gmail.com wrote:
 
 
 
 Hello,
 I am in the process of writing a python web app that should enable the
 user to post picture to twitpic using the Oauth Echo authorization
 mechanism.
 
 The application is already able to post tweet using the Oauth
 authentication so the access_token is available to us in the session.
 
 So my question to 

Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Yann Malet
Zac,
I would love to do this but I can't find any documentation on how to do
Oauth Echo with python-oauth2. I would gladly switch to python-ouath2 if I
could find some code showing How to use it to post a picture on twitpic :
http://dev.twitpic.com/docs/2/upload/

http://dev.twitpic.com/docs/2/upload/Any help would be greatly
appreciated.
Regards,
--yml

On Thu, Jun 3, 2010 at 7:41 PM, Zac Bowling zbowl...@gmail.com wrote:

 It may not help fix your problem but I would recommend upgrading to the
 python-oauth2 library. (Don't be confused by the name; it's not an oauth 2.0
 library, but just the next generation of the original oauth 1.0a library
 that Leah Culver wrote). There are bunch of little issues with the original
 one that don't follow the spec exactly that are fixed and it's not a
 difficult upgrade (as long as your are not hosting an OAuth server of your
 own because those interfaces changed considerably).

 http://github.com/zbowling/python-oauth2 (the fork I maintain with bunch
 of twitter related fixes and workarounds)
 or:
 http://github.com/simplegeo/python-oauth2 (the official upstream)

 Zac Bowling
 @zbowling

 On Jun 3, 2010, at 3:15 PM, Steve C wrote:

  I just looked at your code briefly, but I believe the problem is this
  line:
 
  oauth_request = TwitpicOAuthRequest(http_method=POST,
  http_url=settings.TWITPIC_API_URL,
 
  The OAuth Request needs to be signed using the Twitter Endpoint
  (https://api.twitter.com/1/account/verify_credentials.json), not the
  Twitpic API URL.
 
  Try something like this:
 
  oauth_request = TwitpicOAuthRequest(http_method=GET,
  http_url=https://api.twitter.com/1/account/verify_credentials.json;,
 
 
  On Jun 3, 2:38 pm, yml yann.ma...@gmail.com wrote:
  I would greatly appreciate any help.
  Here it is the latest evolution of this piece of code :
 
  
  class TwitpicOAuthRequest(OAuthRequest):
  def to_header(self, realm='http://api.twitter.com/'):
  headers = super(TwitpicOAuthRequest,
  self).to_header(realm=realm)
  return {'X-Verify-Credentials-Authorization':
  headers['Authorization']}
 
  def post_photo(request):
  if request.method == 'POST':
  form = PhotoForm(request.POST, request.FILES)
  if not request.session.get('twitter_access_token'):
  return HttpResponse(Not authenticated)
  if form.is_valid():
  access_token = request.session['twitter_access_token']
 
  params = {
  'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
  'oauth_signature_method':HMAC-SHA1,
  'oauth_token':access_token.key,
  'oauth_timestamp':oauth.generate_timestamp(),
  'oauth_nonce':oauth.generate_nonce(),
  'oauth_version':'1.0'
  }
 
  consumer =
  oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
  secret=settings.TWITTER_CONSUMER_SECRET)
  token = oauth.OAuthToken(key=access_token.key,
   secret=access_token.secret)
  oauth_request = TwitpicOAuthRequest(http_method=GET,
 
  #http_url=settings.TWITPIC_API_URL,
 
  http_url=settings.TWITTER_VERIFY_CREDENTIALS,
parameters=params)
 
  signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
  consumer,
  access_token)
 
  headers = oauth_request.to_header()
  headers['X-Auth-Service-Provider'] =
  settings.TWITTER_VERIFY_CREDENTIALS
 
  #with multipart_encode
  values = [
  MultipartParam('key',value=settings.TWITPIC_API_KEY),
 
  MultipartParam('message',value=form.cleaned_data['message']),
  MultipartParam('media',
 filename='copine_moi.jpg',
 filetype='image/jpeg',
 fileobj=open(/home/yml/Desktop/
  copine_moi.jpg,rb))
  ]
 
  register_openers()
  datagen, heads = multipart_encode(values)
  headers.update(heads)
  req = urllib2.Request(settings.TWITPIC_API_URL, datagen,
  headers)
  # Post to netcat -l -p 9000
  #req = urllib2.Request(http://127.0.0.1:9000;, datagen,
  headers)
 
  #with urlencode
  #values = {}
  #values['key'] = MultipartParam(settings.TWITPIC_API_KEY)
  #values['message'] =
  MultipartParam(form.cleaned_data['message'])
  #values['media'] = open(/home/yml/Desktop/
  copine_moi.jpg, rb).read()
  #data = urllib.urlencode(values)
  #req = urllib2.Request(settings.TWITPIC_API_URL, data,
  headers)
 
  response = urllib2.urlopen(req)
  return HttpResponse(the photo is posted)
  else:
  form = PhotoForm(initial={created_at:datetime.now()})
 
  return 

[twitter-dev] Tweetbox with default text

2010-06-03 Thread James Kim
hi-

when I make a tweetbox with default text, the Tweet button is grayed
out. Only when I click inside the text area of the tweetbox does the
Tweet button become clickable.

Is there anyway to make it clickable without someone having to click
inside the box? The default text doesn't usually need to modified so I
found myself clicking the grayed out button over and over thinking it
was not working rather than inactive.


[twitter-dev] Twitter API blocks/exists does not work

2010-06-03 Thread Jim
Hello All,
When accessing the blocks/exists api, I do not get valid reponses:

In the console:

{
  request: /1/blocks/exists.json,
  error: Not found
}
(example:
http://dev.twitter.com/console/recall?client_application_id=144824content_type=jsonmethod=GETparam-keys[]=idparam-vals[]=twitterapipath=blocks%2Fexistsversion=1)

When using xAuth:
{request:/1/blocks/exists.json?
screen_name=twitterapi,error:Incorrect signature}

All my other requests (including authentication and posting) work just
fine.

Any ideas?
Thanks,
Jim


Re: [twitter-dev] Tweetbox with default text

2010-06-03 Thread Abraham Williams
http://groups.google.com/group/twitter-dev-anywhere/browse_thread/thread/df3ade5d73b98150

Abraham

On Thu, Jun 3, 2010 at 17:30, James Kim ja...@keytweet.com wrote:

 hi-

 when I make a tweetbox with default text, the Tweet button is grayed
 out. Only when I click inside the text area of the tweetbox does the
 Tweet button become clickable.

 Is there anyway to make it clickable without someone having to click
 inside the box? The default text doesn't usually need to modified so I
 found myself clicking the grayed out button over and over thinking it
 was not working rather than inactive.




-- 
Abraham Williams | Developer for hire | http://abrah.am
@abraham | http://projects.abrah.am | http://blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.


Re: [twitter-dev] Re: OAuth Echo problem in python

2010-06-03 Thread Zac Bowling
Hi Yann,

I don't see anything obvious that stands out as wrong to me in your 
implementation from just looking at it, but I'm not sure. I do have OAuth Echo 
code working for Twitpic but using the OAuth2 library. If you don't figure out 
an answer, you can hit me up off the list and I'll see if I separate our 
version so it works independently and I'll post it on gist for you. 

If you want to upgrade though to python-oauth2, the biggest change is swapping 
out your imports to use oauth2 instead of oauth and removing the OAuth prefix 
on all the class names.

For example:
  import oauth
  oauth.OAuthRequest(...)
  oauth.OAuthToken(...)

becomes: 
  import oauth2
  oauth2.Request(...)
  oauth2.Token(...)

etc...

Most of the API that you care about is identical from there. The library has 
evolved a bit but it should be obvious and most of the public methods remained 
the same. In my fork, I've fixed a few issues and added some changes to support 
XAuth and a few other minor issues (like forcing Authentication headers on 
POSTs for Twitter). 

Zac Bowling
@zbowling




On Jun 3, 2010, at 6:37 PM, Yann Malet wrote:

 Zac,
 I would love to do this but I can't find any documentation on how to do Oauth 
 Echo with python-oauth2. I would gladly switch to python-ouath2 if I could 
 find some code showing How to use it to post a picture on twitpic : 
 http://dev.twitpic.com/docs/2/upload/
 
 Any help would be greatly appreciated.
 Regards,
 --yml
 
 On Thu, Jun 3, 2010 at 7:41 PM, Zac Bowling zbowl...@gmail.com wrote:
 It may not help fix your problem but I would recommend upgrading to the 
 python-oauth2 library. (Don't be confused by the name; it's not an oauth 2.0 
 library, but just the next generation of the original oauth 1.0a library that 
 Leah Culver wrote). There are bunch of little issues with the original one 
 that don't follow the spec exactly that are fixed and it's not a difficult 
 upgrade (as long as your are not hosting an OAuth server of your own because 
 those interfaces changed considerably).
 
 http://github.com/zbowling/python-oauth2 (the fork I maintain with bunch of 
 twitter related fixes and workarounds)
 or:
 http://github.com/simplegeo/python-oauth2 (the official upstream)
 
 Zac Bowling
 @zbowling
 
 On Jun 3, 2010, at 3:15 PM, Steve C wrote:
 
  I just looked at your code briefly, but I believe the problem is this
  line:
 
  oauth_request = TwitpicOAuthRequest(http_method=POST,
  http_url=settings.TWITPIC_API_URL,
 
  The OAuth Request needs to be signed using the Twitter Endpoint
  (https://api.twitter.com/1/account/verify_credentials.json), not the
  Twitpic API URL.
 
  Try something like this:
 
  oauth_request = TwitpicOAuthRequest(http_method=GET,
  http_url=https://api.twitter.com/1/account/verify_credentials.json;,
 
 
  On Jun 3, 2:38 pm, yml yann.ma...@gmail.com wrote:
  I would greatly appreciate any help.
  Here it is the latest evolution of this piece of code :
 
  
  class TwitpicOAuthRequest(OAuthRequest):
  def to_header(self, realm='http://api.twitter.com/'):
  headers = super(TwitpicOAuthRequest,
  self).to_header(realm=realm)
  return {'X-Verify-Credentials-Authorization':
  headers['Authorization']}
 
  def post_photo(request):
  if request.method == 'POST':
  form = PhotoForm(request.POST, request.FILES)
  if not request.session.get('twitter_access_token'):
  return HttpResponse(Not authenticated)
  if form.is_valid():
  access_token = request.session['twitter_access_token']
 
  params = {
  'oauth_consumer_key': settings.TWITTER_CONSUMER_KEY,
  'oauth_signature_method':HMAC-SHA1,
  'oauth_token':access_token.key,
  'oauth_timestamp':oauth.generate_timestamp(),
  'oauth_nonce':oauth.generate_nonce(),
  'oauth_version':'1.0'
  }
 
  consumer =
  oauth.OAuthConsumer(key=settings.TWITTER_CONSUMER_KEY,
 
  secret=settings.TWITTER_CONSUMER_SECRET)
  token = oauth.OAuthToken(key=access_token.key,
   secret=access_token.secret)
  oauth_request = TwitpicOAuthRequest(http_method=GET,
 
  #http_url=settings.TWITPIC_API_URL,
 
  http_url=settings.TWITTER_VERIFY_CREDENTIALS,
parameters=params)
 
  signature=oauth_request.sign_request(OAuthSignatureMethod_HMAC_SHA1(),
  consumer,
  access_token)
 
  headers = oauth_request.to_header()
  headers['X-Auth-Service-Provider'] =
  settings.TWITTER_VERIFY_CREDENTIALS
 
  #with multipart_encode
  values = [
  MultipartParam('key',value=settings.TWITPIC_API_KEY),
 
  MultipartParam('message',value=form.cleaned_data['message']),
  MultipartParam('media',
 filename='copine_moi.jpg',
  

[twitter-dev] users/lookup not working for JSON

2010-06-03 Thread Mo
I might be overlooking something, but it seems like users/lookup isn't
working.  I tried it using my app credentials and got the following
message:

{
  errors: [
{
  code: 17,
  message: No user matches for specified terms
}
  ]
}

Just to be sure, I went to http://dev.twitter.com/console and entered
the parameters from the documentation

http://api.twitter.com/1/users/lookup.xml?user_id=1401881,1401882
http://api.twitter.com/1/users/lookup.xml?screen_name=dougw,raffi

I tried

  1.   user_id in the left field and 1401881,1401882 then followed
that unsuccessful attempt with
  2.   screen_name and dougw,raffi in the right field

The second setting was attempted using both GET and POST with
JSON selected as output, and I got the same message.

After trying a bunch of combinations, using XML seemed to still work,
but no more JSON.


[twitter-dev] Re: Twitter Infographics Data

2010-06-03 Thread Mo
Thanks Abraham.  After I started writing I found a few other
compilations, but none of them referenced the originating article and
designer, so I kept going.  There are a lot of mad geniuses out
there.  The videos are especially creative.

On Jun 3, 10:20 am, Abraham Williams 4bra...@gmail.com wrote:
 Nice collection of infographics.

 Abraham





 On Thu, Jun 3, 2010 at 07:43, Mo maur...@moluv.com wrote:
  I'd like to create a series of blog posts that take Twitter
  application data from various Twitter apps and converts it into
  something visual.  If you have access to data from your own Twitter
  app that you are willing to share, and that you think can reflect a
  major trend in the Twitter ecosphere, or that you've already built an
  infographic/chart/graph/visualizatoin for, please let me know.

  The first post in the series is 18 Tittilating Twitter Infographics
  and Visualizations.  You can find it at

 http://blog.pay4tweet.com/2010/06/02/18-tittilating-twitter-infograph...

  Thanks.

  -Mo
  @pay4tweet

 --
 Abraham Williams | Developer for hire |http://abrah.am
 @abraham |http://projects.abrah.am|http://blog.abrah.am
 This email is: [ ] shareable [x] ask first [ ] private.


[twitter-dev] Annotations with data types

2010-06-03 Thread Harshad RJ
This is the feedback I gave to Twitter as part of the hackfest. Sharing it
here, hoping that we could discuss the idea further.

Lack of strictly defined data-types is going to be like a dynamic
programming language. Every client will have to do it's own type checking.

For example, an annotation currently specifies the location using latitude 
longitude as :

location : {
  latitude : 45.4,
  longitude : 15.2
 }

Now each client would have to check if the numbers are valid floating point
numbers.

What if you suggest a data-type to be appended after the attribute name? for
example:
location : {
  latitude_float : 45,
  longitude_float : 15
 }

Then, when the annotated tweet is being created, Twitter itself can check if
the value conforms to the data type. So all clients can reliably use these
types.

Suggestions for data-types:
int : Integer
float : Floating point number
url : A well formed URL


-- 
Harshad RJ
http://hrj.wikidot.com


[twitter-dev] Annotations in Twitter.com HTML

2010-06-03 Thread Adam
Hi,

I was just thinking regarding the newly proposed annotations, would it
be possible to embed the annotations into the HTML of Twitter.com?
Currently, information such as status id, creation date etc are
included in the HTML tags, which allow some interesting Chrome/Firefox
plugins to be developed. If annotations are included as well, you can
develop some very interesting and useful browser plugins I believe.

What does anyone think about this?

Adam


[twitter-dev] Re: Annotations with data types

2010-06-03 Thread Harshad RJ
On Fri, Jun 4, 2010 at 9:41 AM, Harshad RJ harshad...@gmail.com wrote:

 Suggestions for data-types:
 int : Integer
 float : Floating point number
 url : A well formed URL


To add to this list of data-types:
str: To force to a string

Say, you have an attribute whose label ends with _int. So to force it to a
string you could append _str.
For example:

xyz_int_str : Some string


-- 
Harshad RJ
http://hrj.wikidot.com