Re: [twitter-dev] Re: A new permission level

2011-05-18 Thread Marc Mims
On Wed, May 18, 2011 at 11:37 AM, Jon Colverson jjc1...@gmail.com wrote:

 Also on the subject of granularity, it would be great if the app could
 request DM access but make it optional, such that users can turn it
 off on the authorization page. If the user declines it then the app
 would be able to ask them to reauthorize if they later try to use the
 DM feature of the app.

Agreed.

I'm really disappointed with this change.

Asking users to reauthorize is a burden on both developers and users.
Existing users already gave their permission for apps to access
private messages.

The lead time for developers to respond to this change is ridiculously short.

In my opinion, Twitter should have allowed users finer grained control
over permissions, allowing them to selectively remove private
message permissions for existing apps.

An app should be able to request a set of default permissions.  Users
should be able to accept the defaults, or selectively deny individual
permissions.

If an app has optional private message features, it must request
private message permission from *all* users.  Either that or
register multiple apps for each set of appropriate permissions, which
is confusing and difficult for users and developers to manage.

Is it too late to re-think this, Twitter?

-Marc

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


[twitter-dev] Perl devs: new AutoCursor trait for Net::Twitter

2011-03-27 Thread Marc Mims
If you're using Net::Twitter's friends_ids or follower_ids methods 
without a cursor parameter, an upcoming Twitter API change will break 
your code.

I've added an AutoCursor trait (currently in a developer only release), 
to deal as transparently as possible with the change.

I blogged about it here: http://post.ly/1oKFG

After I get some feedback, I'll make any necessary interface changes and 
make a production release.

-Marc

-- 
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: Perl devs: new AutoCursor trait for Net::Twitter

2011-03-27 Thread Marc Mims
On Mar 27, 4:30 pm, M. Edward (Ed) Borasky zn...@borasky-
research.net wrote:
  I've had explicit cursor / page logic in all my Net::Twitter calls
  since I started using it - is there any reason to switch to AutoCursor?

Probably not. If you're using cursors in the same way AutoCursor does,
then using AutoCursor would make your application code a bit cleaner.
Feel free to have a look at the source code.

AutoCursor is what I will point people to when Twitter throws the
switch and I start getting OMG! The sky is falling! emails. :)

-Marc

-- 
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: Twitter API Timeouts

2011-02-28 Thread Marc Mims
* Taylor Singletary taylorsinglet...@twitter.com [110228 06:57]:
 Thanks for the reports -- we're looking into the timeout issue.

I've been seeing this, too. To combat it, I've set my request timeout to 
8 seconds and I use with Net::Twitter's RetryOnError trait (perl).

Last year, at Chrip, one of the speakers said Twitter's internal 
strategy is to timeout quickly and re-queue.  From my tests, it appears 
requests normally fail in 4-5 seconds with a 502 if they can't be 
fulfilled in that amount of time by the backend.

Taylor, can you confirm that? What is Twitter's internal cutoff? That 
would help me set an optimum request timeout on my end.

FWIW, the Net::Twitter RetryOnError strategy is to retry any request 
that fails with an HTTP status code = 500.  It delays 250ms before the 
first retry and doubles the retry delay until it gets to 4 seconds.  If 
it still can't get a successful return, it throws an error at that 
point.

-Marc

-- 
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] Search API uses different pool of user ids?

2011-02-28 Thread Marc Mims
* ce conor.e...@gmail.com [110228 12:01]:
 A totally different user!  There appears to be no way to get the
 proper numerical id from the search API.  Am I doing something wrong
 or is this a known issue and I should just rewrite to use their screen
 name to look up users instead?

See the Warning here:
http://dev.twitter.com/doc/get/search

-Marc

-- 
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: Intermittent 401 errors calling access_token

2011-02-24 Thread Marc Mims
On Feb 10, 8:40 am, Peter Motyka pmot...@gmail.com wrote:
 I'm seeing intermittent issues as well on the /oauth/access_token endpoint.
  Have you ever gotten to the bottom of this or is it just best to handle the
 error and retry?  Below is a capture of my HTTP requests:

No resolution on this issue. I've collected details on the full chain
of calls for about 100 of these failures, now.  They seem to be
occurring more frequently (although, that may be the result of more
application use rather than a higher failure rate).

Retrying the access_token call does not seem to be sufficient (that
always fails, in my experience); it's necessary to start the process
over with oauth/authorize (or oauth/authenticate).

If Twitter is interested in the details, I'd be happy to supply them.

-Marc

-- 
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: Net::Twitter::Lite cannot authenticate me

2011-01-29 Thread Marc Mims
On Fri, Jan 28, 2011 at 3:02 PM, Sol sol.leder...@gmail.com wrote:
 Where do the access token and access token secret come from?
 I thought they cam from some computation that twitter does with
 the consumer key and consumer_secret. If they don't come from
 there then what do I do to generate/get them?

Visit  http://dev.twitter.com/apps (requires a sign in). From the page
that shows your app's consumer key and secret, select the button on
the right side for your access tokens.

If you are just using Net::Twitter to access your own account, that's
all you need.  If you want other users to have access to your account,
you need to obtain access tokens for them.  See the example code
included in the distribution.  Here's a link to them at Github:
https://github.com/semifor/net-twitter-lite/tree/master/examples

-Marc

-- 
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: Net::Twitter::Lite cannot authenticate me

2011-01-19 Thread Marc Mims
* Sol sol.leder...@gmail.com [110115 11:02]:
 Hello. I'm trying to tweet programmatically using the
 Net::Twitter::Lite perl module. I use their example verbatim, with my
 consumer_key and consumer_secret which I got by registering an app on
 twitter.

Did you also copy/paste your access token and access token secret?  
Those are also required.

-Marc

-- 
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: Intermittent 401 errors calling access_token

2010-12-24 Thread Marc Mims
Here's another one:

### request_token request ###

GET https://api.twitter.com/oauth/request_token
Authorization: OAuth 
oauth_callback=elided,oauth_consumer_key=elided,oauth_nonce=6hEehWMV3NIXsVWyFz4q8mjeTsI,oauth_signature=6hCY%2FrfPwpM%2F1hxvEJ9CxNgHGhU%3D,oauth_signature_method=HMAC-SHA1,oauth_timestamp=1293191794,oauth_version=1.0
User-Agent: Net::Twitter/3.14002 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.14002

### request_token response ###

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Connection: close
Date: Fri, 24 Dec 2010 11:56:49 GMT
Pragma: no-cache
ETag: e7e5d450fe4e32bf4e08e2bb28488221
Server: hi
Vary: Accept-Encoding
Content-Length: 146
Content-Type: text/html; charset=utf-8
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Fri, 24 Dec 2010 11:56:49 GMT
Client-Date: Fri, 24 Dec 2010 11:56:34 GMT
Client-Peer: 128.242.245.29:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Client-SSL-Cert-Subject: 
/serialNumber=Zys2dJJ09EPoEVGXYtegIdxG3OZtEOib/C=US/O=*.twitter.com/OU=GT57932074/OU=See
 www.rapidssl.com/resources/cps (c)10/OU=Domain Control Validated - 
RapidSSL(R)/CN=*.twitter.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: k=67.225.143.18.1293191809136824; path=/; expires=Fri, 31-Dec-10 
11:56:49 GMT; domain=.twitter.com
Set-Cookie: guest_id=129319180914316110; path=/; expires=Sun, 23 Jan 2011 
11:56:49 GMT
Set-Cookie: 
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCHgIPRgtAToHaWQiJWM2NWYwZDYxODQ3NzM2%250AZmFkZTgzOWNkZmZmMTExODZmIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--c23a30feb9142b554775380bf2efb4264170c867;
 domain=.twitter.com; path=/
Status: 200 OK
X-Revision: DEV
X-Runtime: 0.01248
X-Transaction: 1293191809-82130-2825

oauth_token=Zfsd7FDcpeqjSWqAwNyqWpDoK4UMx4WV7VyrfLdlU0oauth_token_secret=9aIb7CQGgXKxMwZ9E5T9mbYgWP4CdcvulKnCC25FtAoauth_callback_confirmed=true

### access_token request ###

GET https://api.twitter.com/oauth/access_token
Authorization: OAuth 
oauth_consumer_key=elided,oauth_nonce=S30WA0bEbJcwIzPDzxAs82UTO0I,oauth_signature=aG%2ByaK9O5dpdVaV%2BEklnQEXMyVM%3D,oauth_signature_method=HMAC-SHA1,oauth_timestamp=1293191803,oauth_token=Zfsd7FDcpeqjSWqAwNyqWpDoK4UMx4WV7VyrfLdlU0,oauth_verifier=S7mhbPhIlc0lV5py7NcwvjYDlcm9vGG6TXqCFPJk,oauth_version=1.0
User-Agent: Net::Twitter/3.14002 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.14002

### access_token response ###

HTTP/1.1 401 Unauthorized
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Connection: close
Date: Fri, 24 Dec 2010 11:56:58 GMT
Pragma: no-cache
Server: hi
Vary: Accept-Encoding
Content-Length: 1
Content-Type: text/html; charset=utf-8
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Fri, 24 Dec 2010 11:56:58 GMT
Client-Date: Fri, 24 Dec 2010 11:56:43 GMT
Client-Peer: 128.242.250.157:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Client-SSL-Cert-Subject: 
/serialNumber=Zys2dJJ09EPoEVGXYtegIdxG3OZtEOib/C=US/O=*.twitter.com/OU=GT57932074/OU=See
 www.rapidssl.com/resources/cps (c)10/OU=Domain Control Validated - 
RapidSSL(R)/CN=*.twitter.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: k=67.225.143.17.1293191818221846; path=/; expires=Fri, 31-Dec-10 
11:56:58 GMT; domain=.twitter.com
Set-Cookie: guest_id=129319181823259876; path=/; expires=Sun, 23 Jan 2011 
11:56:58 GMT
Set-Cookie: 
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPorPRgtAToHaWQiJTE2YzUyNjExZDBmM2Rl%250AN2ZkMDEzNzVmMjRjNjQxNDJjIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--75a4bc3acd6cfb8e2e0940223c37fca8a1c82af0;
 domain=.twitter.com; path=/
Status: 401 Unauthorized
X-Revision: DEV
X-Runtime: 0.01253
X-Transaction: 1293191818-42853-5932

 

-- 
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] Intermittent 401 errors calling access_token

2010-12-23 Thread Marc Mims
I have an ongoing problem with 401 Unauthorized errors calling 
access_token after the user has successfully authorized the app.  It 
happens on a small percentage of calls, but frequently enough (usually 
several times per day) to be quite annoying and leads to user 
complaints.

I've provided the full transaction chain for one of the failed 
authorizations below, eliding identifying values.

You can see from the timestamps in the response headers that entire 
chain was completed it a reasonable amount of time.  I notice a 14 
second difference between the Date and Client-Date headers.  I've 
verified that our server clock is accurate with NTP.

Also note that the final 401 response has no explanation in the body 
(Content-Length: 1).  Whenever I'm able to force a 401 response (e.g., by 
calling access_token with already used request tokens) I get some 
failure explanation in the response body.

Is this a problem on my end or does this indicate a problem on Twitter's 
end?

Is there anything else I can provide to help diagnose this problem?

-Marc


### request_token request ###

GET https://api.twitter.com/oauth/request_token
Authorization: OAuth 
oauth_callback=http%3A%2F%2Felided,oauth_consumer_key=elided,oauth_nonce=i%2FfgTr7omYPt4AAWfD4Bby35UlQ,oauth_signature=48U6n6FRtFYx1iKqtmE36ZMTvdw%3D,oauth_signature_method=HMAC-SHA1,oauth_timestamp=1293104523,oauth_version=1.0
User-Agent: Net::Twitter/3.14002 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.14002


### request_token response ###

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Connection: close
Date: Thu, 23 Dec 2010 11:42:18 GMT
Pragma: no-cache
ETag: 9a7fe06568d1d60ff0edf37ea73d3517
Server: hi
Vary: Accept-Encoding
Content-Length: 145
Content-Type: text/html; charset=utf-8
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Thu, 23 Dec 2010 11:42:18 GMT
Client-Date: Thu, 23 Dec 2010 11:42:04 GMT
Client-Peer: 128.242.245.253:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Client-SSL-Cert-Subject: 
/serialNumber=Zys2dJJ09EPoEVGXYtegIdxG3OZtEOib/C=US/O=*.twitter.com/OU=GT57932074/OU=See
 www.rapidssl.com/resources/cps (c)10/OU=Domain Control Validated - 
RapidSSL(R)/CN=*.twitter.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: k=67.225.143.68.1293104538943773; path=/; expires=Thu, 30-Dec-10 
11:42:18 GMT; domain=.twitter.com
Set-Cookie: guest_id=129310453895441949; path=/; expires=Sat, 22 Jan 2011 
11:42:18 GMT
Set-Cookie: 
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCExlCRMtAToHaWQiJWJjODZjZmI5Mjc2ZTI1%250AY2ZhZWQ0YTQ2YjA5YTRlODZlIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--e77d2ea105e6097a1a23f2d3ab34e11f6581b161;
 domain=.twitter.com; path=/
Status: 200 OK
X-Revision: DEV
X-Runtime: 0.02151
X-Transaction: 1293104538-2524-9007

oauth_token=3G61MtFOzOwUCzFCZ0i7qlBLCNg3GeSBq6JomuChgoauth_token_secret=mgKM5MRmz5tcJwfDsJMASQ4kuSgDIFTuHc83uNmCAYoauth_callback_confirmed=true


### redirect user to Twitter ###

https://api.twitter.com/oauth/authorize?oauth_token=3G61MtFOzOwUCzFCZ0i7qlBLCNg3GeSBq6JomuChg

### user returned to OAuth callback ###

'oauth_token' = '3G61MtFOzOwUCzFCZ0i7qlBLCNg3GeSBq6JomuChg',
'oauth_verifier' = 'kZRqjesOVETmL9Sf7k3NnGRItnKXFm525UN8D6GG7DE'


### access_token request ###

GET https://api.twitter.com/oauth/access_token
Authorization: OAuth 
oauth_consumer_key=elided,oauth_nonce=JhQ00FmtBqcq6wo%2Be%2F60vD%2F8G28,oauth_signature=qb1M%2F9xFvViKpoX8q%2BU%2Bl%2B2UTog%3D,oauth_signature_method=HMAC-SHA1,oauth_timestamp=1293104564,oauth_token=3G61MtFOzOwUCzFCZ0i7qlBLCNg3GeSBq6JomuChg,oauth_verifier=kZRqjesOVETmL9Sf7k3NnGRItnKXFm525UN8D6GG7DE,oauth_version=1.0
User-Agent: Net::Twitter/3.14002 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.14002

### access_token response ###

HTTP/1.1 401 Unauthorized
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Connection: close
Date: Thu, 23 Dec 2010 11:42:59 GMT
Pragma: no-cache
Server: hi
Vary: Accept-Encoding
Content-Length: 1
Content-Type: text/html; charset=utf-8
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Last-Modified: Thu, 23 Dec 2010 11:42:59 GMT
Client-Date: Thu, 23 Dec 2010 11:42:44 GMT
Client-Peer: 128.242.245.221:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Client-SSL-Cert-Subject: 
/serialNumber=Zys2dJJ09EPoEVGXYtegIdxG3OZtEOib/C=US/O=*.twitter.com/OU=GT57932074/OU=See
 www.rapidssl.com/resources/cps (c)10/OU=Domain Control Validated - 
RapidSSL(R)/CN=*.twitter.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: k=67.225.143.17.1293104579798347; path=/; expires=Thu, 

Re: [twitter-dev] Perl developers, watch out for status IDs

2010-11-10 Thread Marc Mims

* Cameron Kaiser spec...@floodgap.com [101109 20:41]:

 If you are on a Perl that does not have 64-bit int and you are not using
 the stringified *_str fields, you may have overflowed the Perl precision
 limit this morning, which bit TTYtter users hard. Just a friendly warning
 to check your code, or use BigInt if you can rely on that support.

Cameron, I'm not experiencing any problems in Net::Twitter applications.
As long as id.  All of JSON::Any backends (JSON::XS, typically) result
in a value that maintains its full precision as long as it's used in a
string context.  Am I missing something that's going to bite me (and
therefore Net::Twitter users in general)?


If you're treating it purely as a string, no (but I don't know how JSON::*
handles things that appear to be integer values, and id is not stringified
itself in the raw JSON).


perl -MJSON::XS=decode_json -E \
'$r=decode_json q({id:9876543210123456789}); say $r-{id}'
# 9876543210123456789

Using Devel::Peek, the decoded 19 digit number is represented as a 
string, internally, by perl:


SV = PV(0x9e98280) at 0x9e3d678
  REFCNT = 1
  FLAGS = (POK,pPOK)
  PV = 0x9c9c0a8 9876543210123456789\0
  CUR = 19
  LEN = 20

So, I think as long as perl apps only use the new, longer IDs in string 
context, they should be ok.  I've tested some typical scenarios using 
each of the JSON::Any backends, storing and retrieving to a MySQL BIGINT 
field, etc.


It may very well be safer to use the id_str values---certainly more 
explicit.  But I haven't found common usage that will fail with the new, 
longer IDs.


-Marc

--
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] Perl developers, watch out for status IDs

2010-11-09 Thread Marc Mims

* Cameron Kaiser spec...@floodgap.com [101106 15:10]:

If you are on a Perl that does not have 64-bit int and you are not using
the stringified *_str fields, you may have overflowed the Perl precision
limit this morning, which bit TTYtter users hard. Just a friendly warning
to check your code, or use BigInt if you can rely on that support.


Cameron, I'm not experiencing any problems in Net::Twitter applications.  
As long as id.  All of JSON::Any backends (JSON::XS, typically) result 
in a value that maintains its full precision as long as it's used in a 
string context.  Am I missing something that's going to bite me (and 
therefore Net::Twitter users in general)?


-Marc

--
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] De-duplicating Site Streams

2010-11-01 Thread Marc Mims
* John Kalucki j...@twitter.com [101031 20:30]:
 Create two in-memory hash sets of seen ids. Write ids to both. If the id is
 found on write, discard. Alternatively expire them every few tens of
  minutes to bound growth, but provide continuous coverage.

That's what I'm doing now for the Streaming API and it works very well.
But in the Site Streams API, I might receive the same ID several times
in context of different users (for_user).

E.g., status N mentions users A, B, and C.  In addition it is favorited
by user D.  If I'm following all 4 users is the in with Site Streams,
I'll see N 4 times in 4 different messages.  However, if any of those
messages is repeated, I need to discard the repeats.

So, I can't simply track status IDs like I do in the Streaming API.  I
need to track for_user/type/status_id.

Or am I missing somethings, here?

-Marc

-- 
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] De-duplicating Site Streams

2010-11-01 Thread Marc Mims
* Mark McBride mmcbr...@twitter.com [101101 12:26]:
 Isn't this a matter of just changing the keys?  status_id becomes
 user_id:status_id?

Yes.  Probably needs to be user_id/type/status_id to accommodate the
case where a user favorites a status she was mentioned in.  We'd get
that one, twice---once for the mention and again for the favorite.

-Marc

-- 
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] Bad timestamp != invalid / used nonce

2010-10-30 Thread Marc Mims
Just helped a user of Net::Twitter troubleshoot a problem.  The user was
getting an invalid / used nonce error on statuses/update.  Turns out,
the time clock was 4 hours off.

An invalid timestamp error would have really been helpful in this
case.  Hint.  HINT. HINT!!! :)

-Marc

-- 
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] De-duplicating Site Streams

2010-10-26 Thread Marc Mims
De-duplicating statuses in the Streaming API is fairly straightforward.
But with Site Streams, where a single status might be received multiple
times for multiple mentioned users, and/or as favorites, it is a bit
more difficult.

I'm wondering if anyone can offer advice on an efficient method for
de-duplicating Site Streams.

-Marc

-- 
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] Net::Twitter::Lite get_authorization_url missing oauth_token ?

2010-10-22 Thread Marc Mims
* James McGill jbmcg...@gmail.com [101021 18:34]:
 I'm trying to use Net::Twitter::Lite OAuth.
 
 [...]
   unless ( $nt-authorized ) {
   # The client is not yet authorized: Do it now
   print Authorize this app at , $nt-get_authorization_url, 
 and enter the PIN#\n;
 [...]
 
 which produces:
 
 Authorize this app at http://twitter.com/oauth/authorize?oauth_token=
 and enter the PIN#
 
 notice that the oauth_token in the url is empty!!
 
 I have Net::OAuth::Simple installed from CPAN.
 
 Has anybody experienced this before? I suspect that it's just some
 missing dependency but I'm not sure what.
 
 Any pointers would be greatly appreciated!!

I'm the author of Net::Twitter::Lite.

Net::Twitter::Lite does not use Net::OAuth::Simple. It uses Net::OAuth
directly (which is a dependency of Net::OAuth::Simple---so if you have
Simple installed, you should also have Net::OAuth).

You should be able to run examples/oauth_desktop.pl (included in the
Net::Twitter::OAuth distribution) directly.  If that works, compare it
to the code you're running.

Feel free to drop by #net-twitter on irc.perl.org or email me directly
for help.

-Marc

-- 
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: Tweeting with Net::Twitter + OAuth

2010-09-30 Thread Marc Mims
* wkossen w.kos...@gmail.com [100930 01:25]:
 
 my $client = Net::Twitter-new(
 traits = ['OAuth', 'API::REST'],
 consumer_key = $ckey,
 consumer_secret = $csec,
 access_token = $atok,
 access_secret = $asec,

Here's the problem.  It's access_token_secret, not access_secret.


I also suggest adding this bit to the top of your script to let perl
help find potential errors:

#!/usr/bin/perl
use warnings;
use strict;

-Marc

-- 
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: Perl Net::Twitter and oAuth

2010-09-30 Thread Marc Mims
* sftriman dal...@gmail.com [100930 10:01]:
 I have a VPS, so I should be able to update perl modules as I'd like
 to.
 Is there some dependency tree that is causing the HTTP::Message
 (and/or HTTP::Request) module to be held back?  Rather than use
 the local::lib approach, I'd just like to get the latest and greatest
 code
 on my server.  Have you run into my problem before?

The problem seems to be on your server.  Whatever cpan mirror it is
pointed at is out of date.  You may need to contact your hosting
provider for assistance with that.

Yes.  I have received reports of this problem before.  Updating
HTTP::Request has resolved the issue for the other reporters.  I need to
update Net::Twitter's Makefile.PL to reflect the dependency, but I
haven't, yet, determined the oldest version of HTTP::Request that
resolves the problem.

 In case it made any difference, I tried both:
 
 $twit-update($tweet);
 my $res = $twit-update({ status = $tweet });

Those 2 calls are identical.  Net::Twitter transforms the first into the
same format as the 2nd internally.

 
 and still got:
 
 HTTP::Message content not bytes at /usr/lib/perl5/site_perl/5.8.8/HTTP/
 Request/Common.pm line 90
 
 in both cases.  Would love to get this fixed!  I really appreciate
 that
 you wrote Net::Twitter, it's been awesome.

Here's a workaround that might help.  Caveat: it will only work with
ASCII status content.  If you post any characters with high bits set,
you'll post improperly encoded UTF8.

{
package My::NetTwitter;
use Moose;
use namespace::autoclean;

extends 'Net::Twitter::Core';
with 'Net::Twitter::Role::OAuth',
'Net::Twitter::Role::API::REST';
# any other traits you want

override _encode_args = sub { $_[1] };

__PACKAGE__-meta-make_immutable;

1;
}

my $twit = My::NetTwitter-new(
consumer_key = $key,
#...
);

$twit-update($tweet);

It might work, for all text (ASCII/Latin-1 and UTF8) to replace the
override line above with this:

use Encode qw/encode_utf8/;
around _encode_args = sub {
my $orig = shift;

my $args = $orig-(@_);
return { map { ref ? $_ : encode_utf8 $_ } %$args;
};

Let me know if that resolves it for you.

-Marc

-- 
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: Why is Basic Auth still enabled on some sources?

2010-09-30 Thread Marc Mims
* sftriman dal...@gmail.com [100930 13:38]:
 Well, finding your site SuperTweet.net today was a great find for me!
 So I hope it doesn't go away any time soon.  And I will be donating to
 your cause shortly.
 
 I updated my perl code using Net::Twitter to do oAuth - but it didn't
 work right.  That's because Net::Twitter has 12+ perl module
 dependencies,
 so I couldn't get the simplest thing to work: a status update.  The
 other
 stuff works ok, though.  And then I found SuperTweet.net, and now
 status updates are a piece of cake!
 
 Thanks for making the site and the service.  Much appreciated.

You might give Net::Twitter::Lite a try.  Very few dependencies and
supports the same core feature set.

-Marc

-- 
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: Perl Net::Twitter and oAuth

2010-09-24 Thread Marc Mims
* sftriman dal...@gmail.com [100923 07:19]:
 I see - well, I'm using cPanel and tried, got this:
 
 Installing Perl Module HTTP::Message
 
 Method: Perl Expect
 Testing connection speed...(using fast method)...Done
 Ping:0 (ticks) Testing connection speed to cpan.erlbaum.net using
 pureperl...(14957.14 bytes/s)...Done
 Ping:0 (ticks) Testing connection speed to mirrors.24-7-solutions.net
 using pureperl...(103966.67 bytes/s)...Done
 Ping:0 (ticks) Testing connection speed to cpan.belfry.net using
 pureperl...(157050.00 bytes/s)...Done
 Three usable mirrors located
 Mirror Check passed for cpan.belfry.net (/index.html)
 commit: wrote '/usr/lib/perl5/5.8.8/CPAN/Config.pm'
 CPAN: Storable loaded ok (v2.21)
 Going to read /home/.cpan/Metadata
   Database was generated on Wed, 22 Sep 2010 00:34:03 GMT
 cPCPAN: Module (HTTP::Message) holdback (5.837 held back to 5.810)
 HTTP::Message is up to date (5.810).
 perlmod--Install done
 
 So not sure what to do.

Take a look at local::lib:
http://search.cpan.org/~getty/local-lib-1.006007/lib/local/lib.pm

You should be able to install your own, local modules in your home
directory.

-Marc

-- 
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] NET::Twitter::Lite

2010-09-23 Thread Marc Mims
* Darren darrenlb...@gmail.com [100922 08:53]:
 I'm using Perl with NET::Twitter::Lite to send messages to an account
 on Twitter which works fine from the command line but as soon as I put
 it inside a CRONTAB it won't work at all. I've got all the paths
 correct for a script within a crontab, it just seems to fail at the
 point it tries to send an update to Twitter...
 
 Any clues???

This typically occurs when you have the PERL5LIB environment variable
set in .bashrc (or elsewhere) in your login enviroment, but not in cron.
Check for PERL5LIB differences between the two environments.

-Marc

-- 
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: NET::Twitter::Lite

2010-09-23 Thread Marc Mims
* Darren darrenlb...@gmail.com [100923 06:04]:
 I've tried adding in PERL5LIB for cron; still a problem the code that
 falls over in the crontab is as follows:
 
 $result = eval { $nt-update($text) };
 
 if ( $@ )
 {
   errorTrap(update failed because: $@);
 }
 
 
 When it runs on the command line no errors; however inside a cron it
 return 'OK' in $result and
 $@ returns a code 200 (ie a success code) and then fails

That would indicate Twitter returned an HTTP 200 response with en error
payload.  Let's try to get more information.  Give this a try:

# make sure you have perl's basic diagnostics help
use warnings;
use strict;
use Data::Dumper;

print Environment:\n, Dumper(\%ENV), \n\n,

my $result = eval { $nt-update($text) };
if ( my $e = $@ ) {
print
HTTP Request:\n,
Dumper($e-http_response-request-as_string), \n\n,
HTTP Response:\n,
Dumper($e-http_response-as_string), \n\n;
}

Hopefully that will shed some light on the problem.

-Marc

-- 
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] Perl Net::Twitter and oAuth

2010-09-21 Thread Marc Mims
* sftriman dal...@gmail.com [100921 16:46]:
 I downloaded the /examples in Net::Twitter, and they don't seem to
 work.  There were 2 in that directory.  I've searched tons on Google,
 and I've read both links on the dev.twitter.com site for perl, but
 can't get those to work.  Maybe someone here can help?

David, see if this helps:
http://github.com/semifor/Net-Twitter/wiki/Net::Twitter-and-the-death-of-Basic-Authentication

-Marc

-- 
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] Tweeting with Net::Twitter + OAuth

2010-09-10 Thread Marc Mims
* wkossen w.kos...@gmail.com [100910 06:45]:
 
 my $client = Net::Twitter-new(
 consumer_key = $ckey,
 consumer_secret = $csec,
 access_token = $atok,
 access_secret = $asec,
 );

You need to include the OAuth trait:

  my $client = Net::Twitter-new(
  traits = ['OAuth', 'API::REST'],
  consumer_key = $ckey,
  consumer_secret = $csec,
  access_token = $atok,
  access_secret = $asec,
  );

For more information, see:
http://github.com/semifor/Net-Twitter/wiki/Net::Twitter-and-the-death-of-Basic-Authentication

-Marc

-- 
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: Simple status update

2010-09-09 Thread Marc Mims
* Gerard M g...@rivershark.com [100909 05:47]:
 Any Perl equivalent for three lines ?  I can convert to PHP if
 needed, but it is a bit of a hassle...

Yes.

See the example code here:
http://github.com/semifor/Net-Twitter/wiki/Net::Twitter-and-the-death-of-Basic-Authentication

-Marc

-- 
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: On the demise of basic authentication.

2010-09-04 Thread Marc Mims
* mikesouthern gb1...@cox.net [100904 19:56]:
 I'm not a developer. I just use perl scripts to automate my twitter
 feeds.

For perl devs, the move to OAuth is really quite easy, especially for
automated scripts.

Register an application at http://dev.twitter.com. Grab the consumer
key and secret, and the access token and secret.

use Net::Twitter;

my $nt = Net::Twitter-new(
traits = [qw/OAuth API::REST/],
consumer_key= $YOUR_CONSUMER_KEY,
consumer_secret = $YOUR_CONSUMER_SECRET,
access_token= $YOUR_ACCESS_TOKEN,
access_token_secret = $YOUR_ACCESS_SECRET,
);

$nt-update(Bob's your uncle!);


Need help?  Just drop by #net-twitter at irc.perl.org.

-Marc

-- 
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: About OAuth

2010-09-04 Thread Marc Mims
* mikesouthern gb1...@cox.net [100904 19:57]:
 But ... but ... I'm trying to do a similar kind of thing from a perl
 command line.

See my reply in an earlier thread:
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/160cb4d3f20ef61

-Marc

-- 
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] cron job perl twitter tweeter

2010-09-04 Thread Marc Mims
* mikesouthern gb1...@cox.net [100904 19:59]:
 I had a really simple perl net::twitter script that ran as a cron job
 off my laptop. All it did was, for each scheduled run, read a single
 line of information from a txt file, then tweet the line to any one of
 three twitter accounts.

Copied from an earlier reply, here:
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/160cb4d3f20ef61

For perl devs, the move to OAuth is really quite easy, especially for
automated scripts.

Register an application at http://dev.twitter.com. Grab the consumer
key and secret, and the access token and secret.

use Net::Twitter;

my $nt = Net::Twitter-new(
traits = [qw/OAuth API::REST/],
consumer_key= $YOUR_CONSUMER_KEY,
consumer_secret = $YOUR_CONSUMER_SECRET,
access_token= $YOUR_ACCESS_TOKEN,
access_token_secret = $YOUR_ACCESS_SECRET,
);

$nt-update(Bob's your uncle!);

Need help?  Just drop by #net-twitter at irc.perl.org.

-Marc 

-- 
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: 401 errors calling access_token

2010-09-02 Thread Marc Mims
* Taylor Singletary taylorsinglet...@twitter.com [100901 08:35]:
 I'll try to respond to you today. It's no excuse, I know, but we've been
 busy! :)

*nudge*

-- 
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] Single Token: Using oauth with Perl: 401 Unauthorized

2010-09-02 Thread Marc Mims
* Lars lars_sa...@hotmail.com [100902 14:38]:
 I am not a Perl expert but I have developed a small web page with Perl
 which is somewhat popular in Germany (according to Alexa trafic rank 
 1000). And this web site is tweeting important events using its own
 twitter account.
 
 I tried for days but I am not able to get it working (tweeting) again.
 
 I registered my web page/application and want to use my access tokens
 oauth_token and oauth_token_secret which I find under my
 application settings because I am using only this twitter account to
 tweet (see http://dev.twitter.com/pages/oauth_single_token)
 
 But the response is always 401 Unauthorized!
 
 Any ideas?
 
 My Perl program looks like this (my provider does not offer the module
 NET::Twitter)

If you have shell access, you can probably install local::lib using the
bootstrap method, then install Net::Twitter or Net::Twitter::Lite in
your own directory.

-Marc

-- 
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] Change in error response objects

2010-09-01 Thread Marc Mims
I'm seeing these error responses on other endpoints, now.

Here's the result of an OAuth authenticated request for friends_ids:
{errors:[{code:53,message:Basic authentication is not supported}]}

Then verify_credentials Authenticating as the same user:
{request:/1/account/verify_credentials.json,error:Could not authenticate 
with OAuth.}

Then an unauthenticated users/show for the same user:
{errors:[{code:63,message:User has been suspended}]}

So, I finally see what the real problem is.  The inconsistency in error
formats and messages is quite difficult to deal with.

I'm also getting these errors for friends_ids.  Interestingly, this is
the response I get using OAuth.
* Raffi Krikorian ra...@twitter.com [100830 05:48]:
 what endpoints are you still seeing this error format under?  the change
 should have been reverted in the case that you were mentioning.
 
 On Sun, Aug 29, 2010 at 9:00 AM, Marc Mims marc.m...@gmail.com wrote:
 
  * Raffi Krikorian ra...@twitter.com [100827 06:03]:
   hi all.
  
   this is most certainly a mistake on our part - we'll be reverting this
   change.
 
  Raffi, we're still seeing these unexpected error structures. When will
  the change be reverted?
 
 -Marc
 
 
 
   On Fri, Aug 27, 2010 at 4:45 AM, Cameron Kaiser spec...@floodgap.com
  wrote:
  
 It looks like error responses have changed, at least for users/show.

 I used to get:
 {error:User has been suspended}

 Now, I get:
 {errors:[{code:63,message:User has been suspended}]}
   
I'm seeing that too. When did this change?
 
  --
  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
 
 
 
 
 -- 
 Raffi Krikorian
 Twitter Platform Team
 http://twitter.com/raffi
 
 -- 
 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


Re: [twitter-dev] Basic Auth

2010-09-01 Thread Marc Mims
* Cradash rand...@gmail.com [100901 06:40]:
 We have been getting a {errors:[{code:53,message:Basic
 authentication is not supported}]} error on our feeds for the last 15
 or so hours, our feeds tweet at most 5 times an hour but have become
 inactive because of this error. We are using Jtwitter and have not had
 an isssue with this untill half-a day ago.

I've been seeing this message for suspended users.  See my most recent
post in this thread:
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/356faad144d2c336/ebf4a20b2dd1a16c?lnk=gstq=error+change#ebf4a20b2dd1a16c

Here's a shortened URL:
http://is.gd/eONAH

An unauthenticated call to users/show for that user may tell you what
the real problem is.

-Marc

-- 
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: 401 errors calling access_token

2010-09-01 Thread Marc Mims
* Taylor Singletary taylorsinglet...@twitter.com [100827 11:11]:
 Can you provide any more details about the error response you're
 giving (like the actual body of the error response)?

Taylor, I emailed the full HTTP request and response along with the
request token/secret for one of these 401 errors we're seeing.  Did you
get that email?  Did it shed any light on the problem?

Although most token exchanges work without error, this happens
frequently enough to be a real concern.  New users are sometimes unable
to register and we lose them forever.

-Marc

-- 
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: 401 errors calling access_token

2010-09-01 Thread Marc Mims
* Taylor Singletary taylorsinglet...@twitter.com [100901 08:35]:
 
 I'll try to respond to you today. It's no excuse, I know, but we've been
 busy! :)

Thanks, Taylor.

-- 
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] Change in error response objects

2010-08-30 Thread Marc Mims
* Raffi Krikorian ra...@twitter.com [100830 05:48]:
 what endpoints are you still seeing this error format under?  the change
 should have been reverted in the case that you were mentioning.

Like Cameron, I'm seeing it on users/show.  Here's an example:
GET http://api.twitter.com/1/users/show/178618878.json

{errors:[{code:63,message:User has been suspended}]}

-Marc

-- 
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: 401 errors calling access_token

2010-08-30 Thread Marc Mims
* Matt Harris thematthar...@twitter.com [100830 16:37]:
 Did you get a chance to send this information through to our support team?

Yes, Matt.  Instead of doing a list reply, I replied directly to Taylor
Singletary with full request and response for a failure case and the
saved response token/secret from session data.

-Marc

 On Fri, Aug 27, 2010 at 5:16 PM, Marc Mims marc.m...@gmail.com wrote:
  * Taylor Singletary taylorsinglet...@twitter.com [100827 11:11]:
  Can you provide any more details about the error response you're
  giving (like the actual body of the error response)?
 
  Taylor, I will capture the full request and response.  I assume they are
  not suitable for posting in a public forum.  Should I email the to
  a...@twitter.com instead?
 
  Can you share an example of a signature base string and POST body that
  failed in this example?
 
  Have you verified that the clock on the device/system originating the
  request is in sync with Twitter's (returned in the Date header of
  every request) by about 5 minutes?
 
  Times are within 1 second.
 
  Do you have any successes to compare against?
 
  The error seems to occur infrequently.  The vast majority of calls
  succeed on exactly the same code path.
 
  The calls are being made with Perl the Net::Twitter library (of which I
  am the author).  Net::Twitter is used by many twitter apps and web apps.
 
  Are your HTTP methods in agreement between what your client is
  actually using (a GET) and the method declared in your signature base
  string?
 
  Yes.
 
         -Marc
 
  --
  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
 
 
 
 
 -- 
 
 
 Matt Harris
 Developer Advocate, Twitter
 http://twitter.com/themattharris
 
 -- 
 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


Re: [twitter-dev] Change in error response objects

2010-08-29 Thread Marc Mims
* Raffi Krikorian ra...@twitter.com [100827 06:03]:
 hi all.
 
 this is most certainly a mistake on our part - we'll be reverting this
 change.

Raffi, we're still seeing these unexpected error structures. When will
the change be reverted?

-Marc



 On Fri, Aug 27, 2010 at 4:45 AM, Cameron Kaiser spec...@floodgap.comwrote:
 
   It looks like error responses have changed, at least for users/show.
  
   I used to get:
   {error:User has been suspended}
  
   Now, I get:
   {errors:[{code:63,message:User has been suspended}]}
 
  I'm seeing that too. When did this change?

-- 
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] Change in error response objects

2010-08-27 Thread Marc Mims
* Raffi Krikorian ra...@twitter.com [100827 06:03]:
 this is most certainly a mistake on our part - we'll be reverting this
 change.

The new error format looks useful, especially if the error code allows
us to deal with multi-lingual error messages consistently.  Obviously,
some advanced notice and consistency across the API will be helpful.

I'm still very interested in seeing Twitter provide library developers
with advanced notice under non-disclosure for changes like this.

-Marc

-- 
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] Change in error response objects

2010-08-27 Thread Marc Mims
* Raffi Krikorian ra...@twitter.com [100827 06:54]:
 All newer API methods have been returning API error codes for a while
 now.  We have been extremely sensitive to not breaking older behavior
 (for backwards compatbility reasons), so older methods still return
 the old format.  We have been toying with the ability to get error
 codes on all methods if developers pass in a special parameter, or
 header, but we haven't gotten very far down that route yet.

Is there documentation for the error codes and format of error responses
for those newer methods?  Which methods support error codes in error
responses?

-Marc

-- 
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: 401 errors calling access_token

2010-08-27 Thread Marc Mims
* Taylor Singletary taylorsinglet...@twitter.com [100827 11:11]:
 Can you provide any more details about the error response you're
 giving (like the actual body of the error response)?

Taylor, I will capture the full request and response.  I assume they are
not suitable for posting in a public forum.  Should I email the to
a...@twitter.com instead?

 Can you share an example of a signature base string and POST body that
 failed in this example?
 
 Have you verified that the clock on the device/system originating the
 request is in sync with Twitter's (returned in the Date header of
 every request) by about 5 minutes?

Times are within 1 second.

 Do you have any successes to compare against?

The error seems to occur infrequently.  The vast majority of calls
succeed on exactly the same code path.

The calls are being made with Perl the Net::Twitter library (of which I
am the author).  Net::Twitter is used by many twitter apps and web apps.

 Are your HTTP methods in agreement between what your client is
 actually using (a GET) and the method declared in your signature base
 string?

Yes.

-Marc

-- 
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] 401 errors calling access_token

2010-08-26 Thread Marc Mims
I occasionally see 401 responses calling access_token.

At the point of call, I have valid request tokens.  The user has been
redirected to Twitter, has authorized the app (as evidenced by the fact
that the user is redirected to the apps's callback URL).

The application uses the oauth_token parameter to retrieve the request
token secret from session data.  The stored request token and
oauth_token parameters match, so I'm confident the correct request token
secret is retrieved.

Yet, calling access_token with the request token/secret and verifier
fails.

I thought it was perhaps a spurious error, so I wrote a retry loop.
Here's a brief snippet from the application log:

access_token returned 401; retrying in 0.25 seconds
access_token returned 401; retrying in 0.5 seconds
access_token returned 401; retrying in 1 seconds
access_token returned 401; retrying in 2 seconds
final error = GET https://api.twitter.com/oauth/access_token failed: 
401 Unauthorized

Why would a call to access_token fail immediately after the user has
authorized the application?

-Marc

-- 
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] 401 errors calling access_token

2010-08-26 Thread Marc Mims
I occasionally see 401 responses calling access_token.

At the point of call, I have valid request tokens.  The user has been
redirected to Twitter, has authorized the app (as evidenced by the
fact
that the user is redirected to the apps's callback URL).

The application uses the oauth_token parameter to retrieve the request
token secret from session data.  The stored request token and
oauth_token parameters match, so I'm confident the correct request
token
secret is retrieved.

Yet, calling access_token with the request token/secret and verifier
fails.

I thought it was perhaps a spurious error, so I wrote a retry loop.
Here's a brief snippet from the application log:

   access_token returned 401; retrying in 0.25 seconds
   access_token returned 401; retrying in 0.5 seconds
   access_token returned 401; retrying in 1 seconds
   access_token returned 401; retrying in 2 seconds
   final error = GET https://api.twitter.com/oauth/access_token
failed: 401 Unauthorized

Why would a call to access_token fail immediately after the user has
authorized the application?

   -Marc

-- 
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] Change in error response objects

2010-08-26 Thread Marc Mims
It looks like error responses have changed, at least for users/show.

I used to get:
{error:User has been suspended}

Now, I get:
{errors:[{code:63,message:User has been suspended}]}

Other methods still return the old format, e.g., statuses/show.  I get:
{request:/1/statuses/show/123456789012345.json,error:No status found 
with that ID.}


Was this change announced?  Will all methods now return an array of
errors?  Is there a documented list of error codes?

-Marc

-- 
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] friends_ids.json and favorites.json return content truncated to 4659 bytes

2010-07-19 Thread Marc Mims
$ curl http://api.twitter.com/1/favorites.json?screen_name=semifor |
xclip
  % Total% Received % Xferd  Average Speed   TimeTime
Time  Current
 Dload  Upload   Total   Spent
Left  Speed
100  4659  100  46590 0  13953  0 --:--:-- --:--:--
--:--:-- 19172


$ xclip -o | wc
4659

$ xclip -o
[{favorited:false,truncated:false,in_reply_to_screen_name:null,in_reply_to_user_id:null,source:a
href=\http://vimtips.mileszs.com\; rel=\nofollow\vimtips/
a,created_at:Fri Jun 11 16:00:08 +
2010,coordinates:null,user:
{profile_background_tile:false,description:Like VI or VIM?  So do
I!  Use it more effectively with daily tips. Catch them all at
http://vimtweets.com.,location:Indiana,statuses_count:361,profile_sidebar_border_color:181A1E,profile_image_url:http://a3.twimg.com/profile_images/64545277/vim_logo_normal.png,profile_use_background_image:true,followers_count:1044,contributors_enabled:false,friends_count:23,screen_name:vimtips,lang:en,geo_enabled:false,created_at:Mon
Aug 25 16:47:56 +
2008,profile_background_color:1A1B1F,favourites_count:
0,verified:false,profile_text_color:66,following:null,time_zone:Eastern
Time (US 
Canada),protected:false,profile_link_color:1f9e10,name:vimtips,profile_background_image_url:http://
s.twimg.com/a/1278188204/images/themes/theme9/bg.gif,url:http://
vimtweets.com,id:
15983724,notifications:null,utc_offset:-18000,profile_sidebar_fill_color:252429},contributors:null,place:null,geo:null,in_reply_to_status_id:null,id:
15938740582,text::%s/\\ v(.*\\ n){5}/\\ r will insert a blank line
every 5 lines (remove spaces)
http://is.gd/6PB6n},{geo:null,in_reply_to_status_id:null,in_reply_to_user_id:null,favorited:false,source:;a
href=\http://www.hootsuite.com\; rel=\nofollow\HootSuite/
a,created_at:Tue Jun 08 22:54:02 +
2010,coordinates:null,user:
{profile_sidebar_fill_color:efefef,description:We are a student
run club on the Gonzaga campus that promotes bike awareness, riding,
and the joy of being on two wheels.,location:Spokane,
WA,notifications:null,profile_background_tile:true,profile_image_url:http://
a1.twimg.com/profile_images/466800814/
gucyclingtwitternew_normal.png,statuses_count:
942,profile_sidebar_border_color:ee,profile_use_background_image:true,followers_count:
678,screen_name:GonzagaCycling,contributors_enabled:false,lang:en,created_at:Tue
Jun 09 04:42:11 + 2009,friends_count:
802,geo_enabled:true,profile_background_color:131516,favourites_count:
0,following:null,verified:false,profile_text_color:33,protected:false,time_zone:Pacific
Time (US  Canada),name:Gonzaga Cycling
Club,profile_link_color:00,url:http://
www.gucycling.com,id:45766143,profile_background_image_url:http://s.twimg.com/a/1278188204/images/themes/theme14/bg.gif,utc_offset:-28800},contributors:null,place:null,id:15738183033,in_reply_to_screen_name:null,truncated:false,text:Car
parked in bike lane? Email the info to Spokane PD at
carparkedinbikel...@spokanepolice.org
http://ow.ly/1VUFV},{favorited:false,truncated:false,in_reply_to_screen_name:null,in_reply_to_user_id:null,source:;a
href=\http://friendfeed.com\; rel=\nofollow\FriendFeed/
a,created_at:Sat May 29 00:04:21 +
2010,coordinates:null,user:
{profile_background_tile:false,description:Social Media Architect
and Developer --\r\nCEO, SocialToo.com --\r\nI blog at StayNAlive.com
--\r\nFather, Entrepreneur, Published Author,location:Salt Lake
City, UT,statuses_count:
23782,profile_sidebar_border_color:a8c7f7,profile_image_url:http://
a1.twimg.com/profile_images/
1033692604/29873_10150181968265113_683545112_12516747_3363132_n_normal.jpg,profile_use_background_image:true,followers_count:
25613,contributors_enabled:false,friends_count:
26102,screen_name:Jesse,lang:en,geo_enabled:true,created_at:Wed
Apr 25 02:48:53 +
2007,profile_background_color:022330,favourites_count:
51,verified:false,profile_text_color:33,following:null,time_zone:Mountain
Time (US 
Canada),protected:false,profile_link_color:0084B4,name:Jesse
Stay,profile_background_image_url:http://s.twimg.com/a/1278724399/
images/themes/theme15/bg.png,url:http://staynalive.com/
jessestay,id:
5485192,notifications:null,utc_offset:-25200,profile_sidebar_fill_color:C0DFEC},contributors:null,place:null,geo:null,in_reply_to_status_id:null,id:
14940747286,text:RSA Animate - Drive: The surprising truth about
what motivates us
http://ff.im/-l5LiR},{favorited:false,truncated:false,contributors:null,in_reply_to_user_id:null,in_reply_to_screen_name:null,source:web,created_at:Tue
May 18 16:37:23 + 2010,coordinates:null,user:
{profile_use_background_imag



Using Net::Twitter, capturing the HTTP request and response, I get:

Request:
GET http://api.twitter.com/1/favorites.json?screen_name=semifor
User-Agent: Net::Twitter/3.13006 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.13006


Response:
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, 

[twitter-dev] Localized API error messages - no, thank you

2010-03-30 Thread Marc Mims
I just noticed this is my application error log:

   Could not follow user: user ist bereits auf Deiner Liste.

The application has special handling for already on your list.

It seems very inappropriate, to me, for the API to localize error
messages.  Certainly, error messages displayed on the web page should be
localized, but APIs are for computers to speak to each other.  I
certainly don't want to add special handling for every language
Twitter provides.

-Marc

To unsubscribe from this group, send email to 
twitter-development-talk+unsubscribegooglegroups.com or reply to this email 
with the words REMOVE ME as the subject.


Re: [twitter-dev] Impossible to make a reliable cursor on timelines using query args

2010-03-12 Thread Marc Mims
* Mark McBride mmcbr...@twitter.com [100312 13:24]:
 Am I missing something regarding the complexity of doing this?
 
 Ruby pseudo-code:
 
 my_unread_tweets = []
 page = 1
 count = 200
 since_id = 123098485120985
 
 while(page_of_tweets = get_tweets(
 http://api.twitter.com/1/statuses/home_timeline.json?page=#{page}count=#{count}since_id=#{since_id};))
 do
   my_unread_tweets  page_of_tweets
 end
 
 I agree it's more complex than
 get_all_my_tweets_disregarding_the_size_of_the_actual_list_since(since_id)...
 however implementing such a method in a scalable way is pretty rough.

I've never found since_id reliable.  If I read the home timeline and
save the most recent since_id, I often discover that new (i.e., statuses
I've never seen) get posted out of sequence---they have lower IDs than
the most recent since_id I saved.

I think that's what makes using since_id as a cursor difficult.

As a work-around, I keep a list of the most recent 200 ids I've seen and
always get some overlap on a new call so I can pick up any recent
statuses delivered out of order.

-Marc


Re: [twitter-dev] More Streaming API data, please

2010-03-10 Thread Marc Mims
* John Kalucki j...@twitter.com [100310 09:56]:
 Noted. In the plan.
 
 [Wait a second, is this Mark McBride on a fake account?]

No. Haven't met Mark McBride, yet, but I'm sure I'm not him.  And I'm
real---at least I think so.  But you've got me worried, now. :)

@semifor, Marc-with-a-cee, the Net::Twitter guy


Re: [twitter-dev] Tracking number of users for an OAuth app

2010-03-09 Thread Marc Mims
* Michael Steuer mste...@gmail.com [100309 17:25]:
 Wouldn't you yourself know best how to calculate how many people are
 actively using your app?

Sure, if it's a web app.  But if it's a desktop app, especially an open
source desktop app, the count twitter provides may be the only way to
know.

@semifor


Re: [twitter-dev] Re: Introduce yourself!

2010-03-04 Thread Marc Mims
* M. Edward (Ed) Borasky zzn...@gmail.com [100303 19:46]:
 I haven't looked at all of the libraries, but the two I've worked
 with, one in Ruby and one in Perl, both translate the raw JSON
 coming out of Streaming into native objects. This isn't going to
 scale, and Twitter recommends against it.

Perl AnyEvent::Twitter::Stream now has a no_decode_json option:
http://twitter.com/miyagawa/status/9851560584

@semifor


Re: [twitter-dev] Re: xAuth

2010-03-03 Thread Marc Mims
* Berto mstbe...@gmail.com [100303 06:42]:
 Isn't that using a GET request versus the docs saying POST?  And I
 thought parameters were supposed to be normalized except for signature
 which gets attached at the end?

Hmmm. I completely missed the fact that the documentation specifies
POST.  I used GET and it worked.  When I use a POST, I get a 401.

Doc bug?

The order you *send* the parameters doesn't matter---the order of the
base string used for generating the signature does.

The underlying libraries I use assemble the parameters in an arbitrary
order.  Generation of the signature is a separate call and builds it's
own base string from a hash (associative array).

@semifor


[twitter-dev] Perl Net::Twitter - support for new geo location features

2010-03-02 Thread Marc Mims
In response the announcement of new upcoming geo features [1], I've
released a new verison of Perl Net::Twitter two new methods:

- reverse_geocode
- geo_id

The update method has been updated to include new parameters:

- place_id
- display_coordinates

The new version will be available soon at CPAN mirror near you. [2]

Enjoy!

@semifor


[1]
http://groups.google.com/group/twitter-api-announce/browse_thread/thread/e7fc06e4a8cb7150

[2] http://search.cpan.org/~mmims/Net-Twitter-3.11008/


Re: [twitter-dev] Re: xAuth

2010-03-02 Thread Marc Mims
* Berto mstbe...@gmail.com [100302 13:28]:
 At first I thought this might be because HttpURLConnection wasn't
 handling SSL, but then I switched over to HttpPost (this code is in
 Java) which I know will handle SSL and I'm still getting a 401.  I'm
 doing everything the same as with oauth, except passing the request
 token (I'm not even getting a request token any more) and I'm passing
 the x_auth_* parameters as regular parameters in the POST body.  The
 three x_auth_* parameters are my only parameters and the normal OAuth
 header is in the Authorization field.  I'm POSTing to the new access
 URL as specified in the xAuth docs with no success .
 
 Thoughts anyone?  I feel like such a noob asking for so much help with
 oAuth/xAuth :\.

I have successfully implemented xAuth in the Perl Net::Twitter library.
Here's what a Net::Twitter generated xAuth request looks like:

GET 
https://twitter.com/oauth/access_token?oauth_consumer_key=CONSUMER_KEYoauth_nonce=t7exD9FGmYkMfi0PIYGdlXnlF04oauth_signature=E3ef0zZ%2B%2Btnaf7tQdTDu2znFyjI%3Doauth_signature_method=HMAC-SHA1oauth_timestamp=1267565624oauth_version=1.0x_auth_mode=client_authx_auth_password=secretx_auth_username=fred
User-Agent: Net::Twitter/3.11008 (Perl)
X-Twitter-Client: Perl Net::Twitter
X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
X-Twitter-Client-Version: 3.11008


For this example, I used:

   consumer_key= 'CONSUMER_KEY'
   consumer_secret = 'CONSUMER_SECRET'
   x_auth_username = 'fred'
   x_auth_secret   = 'secret'

Hope this helps.

@semifor


Re: [twitter-dev] Re: forcing api.twitter.com resources - tomorrow

2010-03-02 Thread Marc Mims
* TJ Luoma luo...@luomat.net [100302 15:58]:
 I'm not even sure what Twitter is talking about. The initial post in
 this thread was completely vague.
 
 This is fairly troublesome, considering that:
 
 $ curl --location --referer ;auto -D - -s --netrc
 http://api.twitter.com/1/account/verify_credentials.xml;
 
 fails but
 
 $ curl --location --referer ;auto -D - -s --netrc
 http://twitter.com/account/verify_credentials.xml;
 
 works fine (as I mentioned earlier in another thread).
 
 I don't know why, but it's been doing it all day.
 
 I wonder how much other stuff is going to break tomorrow.

Both of those curl commands work for me.  Perhaps you have a .netrc
entry for twitter.com but not for api.twitter.com?

@semifor


[twitter-dev] Re: xAuth implemented in Perl Net::Twitter

2010-02-27 Thread Marc Mims
* Marc Mims marc.m...@gmail.com [100226 17:36]:
 I have implemented xAuth in Perl Net::Twitter, but it is currently
 untested.  I am waiting approval of an xAuth access request for one of
 my own OAuth apps so I can test it.
 
Raffi gave me xAuth access to one of my own apps.  After a minor code
change, it works.  I shipped a new release with xAuth support to CPAN.
Coming to a mirror near you [1].

@semifor


[1] http://search.cpan.org/~mmims/Net-Twitter-3.11007/


[twitter-dev] xAuth implemented in Perl Net::Twitter

2010-02-26 Thread Marc Mims
I have implemented xAuth in Perl Net::Twitter, but it is currently
untested.  I am waiting approval of an xAuth access request for one of
my own OAuth apps so I can test it.

I shipped a developer release to CPAN. It should be available, soon [1].

If you're a perl dev and have xAuth access for your application, please
download and test the developer release and give me some feedback.

The documentation [2] indicates xAuth will return a 403 if the
application hasn't been authorized.  I'm getting a 401.  Net::Twitter
bug? Twitter bug?  Twitter doc bug?

[1] http://search.cpan.org/~mmims/Net-Twitter-3.11006_01/
[2]
http://apiwiki.twitter.com/Twitter-REST-API-Method:-oauth-access_token-for-xAuth

@semifor


Re: [twitter-dev] Permanent Profile URL

2010-02-23 Thread Marc Mims
* Lil Peck lilp...@gmail.com [100223 10:48]:
 On Mon, Feb 22, 2010 at 11:10 PM, Paul Tarjan ptar...@gmail.com wrote:
  Is there a permanent profile URL for users? Something like
 
  http://twitter.com/account/profile?user_id=14757201
 
  I'd like something that is ID based (since users can change their
  short form) but is guaranteed to resolve for a while. Possibly even
  302ing to the http://twitter.com/name
 
  I could use
 
  http://api.twitter.com/1/users/show.xml?user_id=14757201
 
  but it is rather long and doesn't return any nice HTML
 
 
 
 You could make a custom TinyURL.

http://twitter.com/account/redirect_by_id?id=14757201

-Marc


Re: [twitter-dev] Streaming API connection abandonment separation anxiety issues

2010-02-22 Thread Marc Mims
* John Kalucki j...@twitter.com [100222 10:51]:
 If you had a correlative experience within a minute or so of 15:55 UTC,
 please respond to this message.

Indeed, I did.  From the application log:

2010/02/22 07:56:14 9481340618: RT @whitehouse: The Presi...
2010/02/22 07:57:14 timeout
2010/02/22 07:57:14 Waiting 0 seconds before reconnecting...
2010/02/22 07:57:14 connecting

-Marc


Re: [twitter-dev] Re: Streaming API connection abandonment separation anxiety issues

2010-02-22 Thread Marc Mims
 On Mon, Feb 22, 2010 at 1:53 PM, Scott Wilcox sc...@tig.gr wrote:
 
  Same issue here, over the past six hours more than ever.

* John Kalucki j...@twitter.com [100222 14:25]:
 I don't believe that we've seen this issue since 15:55 UTC. If you've been
 seeing hangs more often, it's possible that you are experiencing another
 problem. Or, equally likely, there is another set of things going wrong.
 
 I've restarted the cluster twice today, but this shouldn't cause hanging --
 just closed connections.

Maybe Scott is seeing the same thing I am.  This morning's 15:55 UTC
event (1).  Then three close connections (2,3,4).  Then two timeouts
(5,6) immediately following the last closed connection.  (Times are in
PST).

2010/02/22 07:56:14 9481340618: RT @whitehouse: The Presi...
1   2010/02/22 07:57:14 timeout
2010/02/22 07:57:14 Waiting 0 seconds before reconnecting...
2010/02/22 07:57:14 connecting
--
2010/02/22 13:47:08 9494846704: @danmartell don't spend i...
2   2010/02/22 13:47:09 AnyEvent::Handle::destroyed=HASH(0x3d12c00)
2010/02/22 13:47:09 Waiting 0 seconds before reconnecting...
2010/02/22 13:47:09 connecting
--
2010/02/22 13:49:15 ping
3   2010/02/22 13:49:23 AnyEvent::Handle::destroyed=HASH(0x43faf70)
2010/02/22 13:49:23 Waiting 0 seconds before reconnecting...
2010/02/22 13:49:23 connecting
--
2010/02/22 14:17:35 9496041457: @greenrd Homeopathy reall...
4   2010/02/22 14:17:41 AnyEvent::Handle::destroyed=HASH(0x44080b0)
2010/02/22 14:17:41 Waiting 0 seconds before reconnecting...
2010/02/22 14:17:41 connecting
5   2010/02/22 14:18:41 timeout
2010/02/22 14:18:41 Waiting 0 seconds before reconnecting...
2010/02/22 14:18:41 connecting
6   2010/02/22 14:19:41 timeout
2010/02/22 14:19:41 Waiting 0 seconds before reconnecting...
2010/02/22 14:19:41 connecting



Re: [twitter-dev] Introduce yourself!

2010-02-20 Thread Marc Mims
Marc Mims. @semifor. Author and maintainer of Net::Twitter [1], the Perl
interface to the Twitter API.  I'm a freelance software developer
specializing in modern perl (Moose, Catalyst, DBIx::Class, and
Net::Twitter, of course).

I'm a Linux enthusiast and run Debian on my personal systems with
xmonad, Vim, Firefox+Vimperator. Give me text, and take the mouse with
you. :)

My first Twitter app was Twirc [2], a local IRC gateway for Twitter.
It's the Twitter client I use.

Chris Thompson wrote and maintained Net::Twitter through version 2.12. I
wrote replacement, from scratch, and Chris handed off the project to me.
So I authored Net::Twitter 3.0 and maintain it, currently.

Net::Twitter and the community of users and applications they've built
have been a joy to work with.  I'm registered for Chirp and I'm doing a
little fund raising from the Net::Twitter users to help cover the costs
of attending [3].

In my spare time, I'm working on packrati.us (@packratius) [4], a
Twitter + Delicious mashup.  It started as a simple learning project for
OAuth and the Streaming API.  I'm really pleased with the backend code,
which is where most of the effort has gone.  If I can shake loose some
more time, I need to do plenty of front end work (a designer I am not)
and add some features to make it useful to a wider audience.

I'll 2nd @Abraham's feature request for a conversation method returning
replies for a specified status.  I'd also like to see some consistency
in error handling. Getting Not authorized for user_timeline can mean
(1) the account is protected and the authenticated user is not
authorized, (2) the account is suspended, (3) the account has 0 tweets.
Getting a 500 response with HTML content from the Search API is
unhelpful; getting an error response in the requested format would be
much saner.  There are many other inconsistencies in error responses.
Life would be easier if they were addressed.

Looking forward to Chirp and meeting some other Twitter devs there.

@semifor

[1] http://search.cpan.org/dist/Net-Twitter
[2] http://search.cpan.org/dist/POE-Component-Server-Twirc/
[3]
http://semifor.posterous.com/how-1000-became-0-and-how-it-can-be-fixed-for
[4] http://packrati.us


Re: [twitter-dev] Streaming API question

2010-02-20 Thread Marc Mims
* rob robert.bag...@gmail.com [100219 08:56]:
 Has anyone else ran into an issue where over time the Streaming API
 just stops sending results?

Yes. I'm seeing the same thing.  I've set up a 45 second timeout. The
following entries were extracted from the application log.  I'm
currently following  100 users, so periods of inactivity are not
unusual.  Receipt of keep alive packets are indicated by ping.  If
there's no activity for 45 seconds, I drop the connection and reconnect.
Times are PST.

@semifor


2010/02/09 14:39:44 connecting
2010/02/09 14:40:29 timeout
2010/02/09 14:40:29 Waiting 0 seconds before reconnecting...
--
2010/02/09 16:09:10 ping
2010/02/09 16:09:40 ping
2010/02/09 16:10:25 timeout
2010/02/09 16:10:25 Waiting 0 seconds before reconnecting...
2010/02/09 16:10:25 connecting
2010/02/09 16:11:10 timeout
2010/02/09 16:11:10 Waiting 0 seconds before reconnecting...
--
2010/02/11 08:54:04 8968466186: @BarackObama. Gd morning MR President. OMG u twi
2010/02/11 08:54:49 timeout
2010/02/11 08:54:49 Waiting 0 seconds before reconnecting...
2010/02/11 08:54:49 connecting
2010/02/11 08:55:34 timeout
2010/02/11 08:55:34 Waiting 0 seconds before reconnecting...
--
2010/02/12 08:50:40 ping
2010/02/12 08:51:10 ping
2010/02/12 08:51:55 timeout
2010/02/12 08:51:55 Waiting 0 seconds before reconnecting...
--
2010/02/12 11:45:05 ping
2010/02/12 11:45:35 ping
2010/02/12 11:46:20 timeout
2010/02/12 11:46:20 Waiting 0 seconds before reconnecting...
2010/02/12 11:46:20 connecting
2010/02/12 11:47:05 timeout
2010/02/12 11:47:05 Waiting 0 seconds before reconnecting...
--
2010/02/16 07:11:25 9188373420: @alexpriest oh Alex, you're a fool. Haha. :D Dri
2010/02/16 07:11:55 ping
2010/02/16 07:12:40 timeout
2010/02/16 07:12:40 Waiting 0 seconds before reconnecting...
--
2010/02/16 08:38:49 Waiting 0 seconds before reconnecting...
2010/02/16 08:38:49 connecting
2010/02/16 08:39:34 timeout
2010/02/16 08:39:34 Waiting 0 seconds before reconnecting...
--
2010/02/17 07:28:03 9238057534: @BarackObama President B. Pls explain this to us
2010/02/17 07:28:48 timeout
2010/02/17 07:28:48 Waiting 0 seconds before reconnecting...
--
2010/02/18 09:24:21 9292626812: @SuzieLin no problem! So far can't complain, jus
2010/02/18 09:24:50 9292645527: @BarackObama Another terrorism actack? How many 
2010/02/18 09:25:35 timeout
2010/02/18 09:25:35 Waiting 0 seconds before reconnecting...
--
2010/02/19 09:36:16 9344797252: @BarackObama  We The People want the #PNHP at 
2010/02/19 09:37:01 timeout
2010/02/19 09:37:01 Waiting 0 seconds before reconnecting...
2010/02/19 09:37:01 connecting
2010/02/19 09:37:46 timeout
2010/02/19 09:37:46 Waiting 0 seconds before reconnecting...


Re: [twitter-dev] Streaming API question

2010-02-20 Thread Marc Mims
* John Kalucki j...@twitter.com [100220 20:24]:
 A 45 second period of inactivity is not unusual when following just 100, or
 even 100,000 users. The keep-alive newlines are only sent once every 10
 minutes. You should not reconnect so aggressively.

I can certainly set the time out to 10 minutes.  I'm seeing newlines in
the stream every 30 seconds, except for rare occasions. I understood
those to be keep-alive packets.  Apparently they are not and should not
be relied on?

@semifor


Re: [twitter-dev] Streaming API question

2010-02-20 Thread Marc Mims
* John Kalucki j...@twitter.com [100220 21:02]:
 Arg. This is what I get for not checking the configuration each time. Yes,
 it's currently set to send a newline every 30 seconds.

Ok.  Sorry to drag this out, but what, then, is an appropriate timeout
value for the application?

@semifor


Re: [twitter-dev] Re: streaming apis + oauth

2010-02-03 Thread Marc Mims
* John Kalucki jkalu...@gmail.com [091030 06:41]:
 Currently the Streaming APIs are not intended for use by clients, but
 mostly for use by services. Therefore oauth is not yet supported.
 There's little need to pass an end-user's credentials on to the
 Streaming API as all data currently available is public. Rather, your
 service can request all required data on behalf of your end users with
 a single account.

The Streaming API uses Basic Authentication over a non-encrypted
connection, only, right?  This frightens me, a bit.  Seems anyone with
the ability to sniff traffic on the hosting provider's network could
hijack my twitter account causing me no end of grief.

Is there, or will there be, a more secure method of authentication for
the Streaming API?

-Marc


Re: [twitter-dev] Re: a security problem puzzled me about using oauth in Desktop Client

2010-02-01 Thread Marc Mims
* Raffi Krikorian ra...@twitter.com [100201 07:36]:
 
  c. The Streaming API isn't designed to play well with desktops /
  laptops / mobiles.
 
 
 (not to change the direction of the thread) just out of curiosity - why do
 you think that's the case?  we don't intend it not to play well, and want to
 know what you think should be fixed.

As I understand it, the Streaming API uses only Basic Authentication
*without* SSL.  That frightens me.  It means anyone who can sniff
traffic at the hosting site I use can hijack the account I use for
Streaming API access.

Now that the Streaming API is no longer beta, will Twitter be providing
some more secure mechanism for authenticating?

-Marc


Re: [twitter-dev] Using OAuth keys in an open source application

2010-01-18 Thread Marc Mims
* Isaiah Carew isa...@me.com [100118 19:02]:
 If every person that uses an app accesses the API with their own personal app 
 credentials that would mean the app would appear to Twitter as hundreds, or 
 potentially thousands, of individual applications.
 
 One goal of application registration is to control application privileges en 
 masse.  So that when malware is found it's privileges can be revoked quickly. 
  Or even in the more banal case: an app doing something taxing to the API. 
 The privileges could be revoked/modified until the problem was fixed and then 
 reenabled -- all while the users are blissfully unaware.
 
 If each person who uses an app registers it themselves then Twitter no longer 
 has the ability to monitor the app as a whole, essentially crippling one of 
 OAuth's most compelling reasons for being.

Hopefully twitter suspends user accounts, not application access, when
malicious activity is detected.  Otherwise, all desktop apps, whether
closed or open source, are vulnerable.

It isn't difficult to extract the consumer key and secret from any
desktop application that ships with them and use them in malicious code.

Registering a consumer key/secret for every instance of a desktop
application seems like an unreasonable requirement to place on users.
So, I agree that isn't the solution.  I certainly want to see the user
count on my OAuth apps page for the desktop apps I release.  Per user
consumer keys not only prevent Twitter from application tracking, they
also prevent the application developer from tracking it as well.

Consider the consumer key and secret public for desktop apps.  They are.

-Marc


Re: [twitter-dev] Using OAuth keys in an open source application

2010-01-18 Thread Marc Mims
* ryan alford ryanalford...@gmail.com [100118 20:01]:
 The consumer secret is not public.  The consumer key can be seen in the
 query parameters, but the consumer secret is not a query parameter.  It
 would have to be reverse engineered using the signature.
 
 If twitter determines that a specific application is malware, I would only
 hope that they would blacklist the app.

Point is, reverse engineering it is easy.  It isn't in the query
parameters, but it is required to sign the request.  So, stepping into
the signature code in a debugger will expose it.

The consumer key pair might as well be considered public for desktop
apps.  Calling it secret doesn't make it secret.

If the only solution to the problem is requiring each user to register
their own consumer key pair, then Twitter can't shut down a malware
application.  Each user will appear to have a different app.

That defeats the whole purpose.

-Marc


Re: [twitter-dev] Re: Using OAuth keys in an open source application

2010-01-18 Thread Marc Mims
* Abraham Williams 4bra...@gmail.com [100118 20:10]:
 If rolling out a new update is a burdon on you and your user you are doing
 it wrong. http://code.google.com/p/omaha/

Rolling out a new version because someone compromised the consumer key
pair is a burden.  Are you prepared to roll out a new version every few
minutes?

-Marc


Re: [twitter-dev] Re: Using OAuth keys in an open source application

2010-01-18 Thread Marc Mims
* John Meyer john.l.me...@gmail.com [100118 20:12]:
 Which would probably have its own feasibility problems.  If I'm a
 malware producer, for instance, I'm not just going to compromise one
 user account with one consumer keypair. I'm going to compromise ten
 thousand users.

That's the beauty of OAuth.  Even if you know the consumer key pair,
it's worthless without user access tokens.

So, the bad guy can't exploit the entire app's user base.

Which is why I think Twitter should not disable apps when they see
malicious activity.  They should disable user accounts.

-Marc


Re: [twitter-dev] Re: Using OAuth keys in an open source application

2010-01-18 Thread Marc Mims
* ryan alford ryanalford...@gmail.com [100118 21:03]:
 Who said that was even an option?  I haven't seen one person who said that
 requiring every user to create their own consumer keys to use with an
 application was an option.  The only reason that is even in this discussion
 is because somebody misinterpreted an answer and that's what they thought
 was meant.  I have never seen one person from twitter even come close to
 suggesting this as an option.

Perhaps I misunderstood this:

* John Meyer john.l.me...@gmail.com [100118 10:24]:
 Something like that.  Ideally, what I would do is configure the app
 so that if the consumerkeys (both secret and non) are not present,
 the user is directed to a screen to input those for themselves (with
 maybe a helpful link to get them in the first place).

And the original poster said he's developing an application, not a
library.  I may have misunderstood him, as well.

My comments in this thread have simply been pointing out that for a
desktop application, distributed to end users, the consumer key pair
cannot be kept secret.  Therefore, disabling an application because of
inappropriate use is---well---inappropriate.  The user account should be
disabled, leaving the vast majority of (hopefully) well behaved users
unaffected.

-Marc


Re: [twitter-dev] Cursor Expiration

2010-01-16 Thread Marc Mims
* John Kalucki j...@twitter.com [091209 09:28]:
 A cursor should be valid forever, but as it ages and rows are removed, you
 might see some minor data loss and probably more duplicates.

Out of curiosity, what is a cursor?  From our (the users') perspective,
it's just an opaque number.  But I'm curious.  How is it generated?
What does it represent internally?

-Marc


[twitter-dev] Re: Net::Twitter dev release with Lists API support

2009-10-29 Thread Marc Mims

* Scott Elcomb pse...@gmail.com [091028 21:37]:
 On Sat, Oct 24, 2009 at 12:47 AM, Marc Mims marc.m...@gmail.com wrote:
  In my own testing, I've noticed that the update_list call always returns
  a 500 status, even though it succeeds.  That's probably a Twitter bug
  that will be worked out.
 
 I'm seeing the same behaviour here.  However when calling
 $nt-delete_list($user, $slug) on my test list, the list remains and I
 get the response:
 
   unexpected HTTP method: DELETE at
 [path-to]/perl/5.10.0/Net/Twitter/Role/API/Lists.pm line 119

Did you install the full developer release, or just the
Net::Twitter::Role::API::Lists module?  Are you using Basic or OAuth
authentication?

Changes were made to both Net::Twitter::Core and
Net::Twitter::Role::OAuth to support the DELETE method.  Either you
don't have those updated modules or I have a bug in one (or both) of
them.

I've tested it on my own account with both Basic and OAuth and
delete_list is successful, so if you've got the correct Core and OAuth
modules perhaps a stack trace would shed some light.

-Marc


[twitter-dev] Net::Twitter dev release with Lists API support

2009-10-23 Thread Marc Mims

I uploaded a development release of Net::Twitter to CPAN with Lists API
support.  If you're a perl developer and you're on the Lists beta,
please test it and give me some feedback.

Download it here:
http://search.cpan.org/~mmims/Net-Twitter-3.07999_01/

For documentation see:

perldoc Net::Twitter::Role::API::Lists

You'll need to include the API::Lists trait:

my $nt = Net::Twitter-new(traits = ['API::Lists', ...], ...);

You can always use the user parameter as the first placeholder
argument to any of the API calls.  Any or all of the parameters included
in the API URL can be passed as placeholder arguments.  Additional
arguments are passed by name in a HASH ref as the final argument.  Any
or all parameters can be passed in the HASH ref.

For example, these calls are equivalent:

my $list = $nt-create_list(perl_api =
{ name = 'test', mode = private }
);

my $list = $nt-create_list({
user = 'perl_api',
name = 'test',
mode = 'private',
});

In my own testing, I've noticed that the update_list call always returns
a 500 status, even though it succeeds.  That's probably a Twitter bug
that will be worked out.

The Lists API support is experimental.  It will very likely change
before a final release.  Feedback welcome.

-Marc


[twitter-dev] Re: Perl OAuth - updated example

2009-10-22 Thread Marc Mims

On Oct 21, 11:28 pm, Nigel Cannings nigelcanni...@googlemail.com
wrote:
 Sorry, I should have said that it is the authorization url that
 remains the same until a user actually accepts your application.

 It is the authorization url that becomes stale if reused, or unused
 for a period of time.  Access tokens, as you quite rightly say, don't
 expire unless revoked.

I'm going to call this a bug in Net::Twitter
(Net::Twitter::Role::OAuth,
specifically).  It caches the request_token and reuses it on
subsequent
calls.  I don't see any reason it should.

So, with this simple fix to Net::Twitter::Role::OAuth, the example app
should work correctly, unmodified:

diff --git a/lib/Net/Twitter/Role/OAuth.pm b/lib/Net/Twitter/Role/
OAuth.pm
index 0bb48cc..a1994fc 100644
--- a/lib/Net/Twitter/Role/OAuth.pm
+++ b/lib/Net/Twitter/Role/OAuth.pm
@@ -60,7 +60,7 @@ sub authorized {
 sub _get_auth_url {
 my ($self, $which_url, %params ) = @_;

-$self-_request_request_token(%params) unless $self-
has_request_token;
+$self-_request_request_token(%params);

 my $uri = $self-$which_url;
 $uri-query_form(oauth_token = $self-request_token);

The example app can be modified to work with the un-patched ::OAuth by
clearing the request_token in sub twitter:

sub twitter {
my $nt = shift-{twitter} ||= Net::Twitter-new(traits = [qw/
API::REST OAuth/], %consumer_tokens);
$nt-clear_request_token;
return $nt;
}

That way, a new Net::Twitter object isn't required on each request.

Thanks for posting your find, Nigel. It resulted in an important bug
fix.
If you find more, please post them at:
http://rt.cpan.org/Public/Dist/Display.html?Name=Net-Twitter

They'll get to me more directly, there.

-Marc


[twitter-dev] Re: Perl OAuth - updated example

2009-10-22 Thread Marc Mims

On Oct 22, 12:54 am, Jesse Stay jesses...@gmail.com wrote:
 Same here! BTW, if anyone wants a Catalyst OAuth Authentication::Credentials
 module I've got one written - just getting it ready for CPAN right now.

Jesse, let me know when the module is on CPAN.  I'll add it to the SEE
ALSO
section in the Net::Twitter and Net::Twitter::Lite docs.

-Marc


[twitter-dev] Re: Perl OAuth - updated example

2009-10-21 Thread Marc Mims

On Oct 20, 4:28 am, Nigel Cannings nigelcanni...@googlemail.com
wrote:
 I found an issue using the server example included in Net::Twitter
 (oauth_webapp.pl).

Hi, Nigel.  I'm the author of Net::Twitter.  I'd like to update the
sample included
with the distribution to fix the problem you encountered, but I don't
completely
understand your explanation.

 Every time someone connected with the server, it re-used the same OAuth
 token, until they actually signed up with the app.  Well, not everyone,
 once they've gone to the authorization URL, actually signs up, so fairly
 quickly, the token becomes stale, and then no-one can sign up.  My fault
 for having an app no-one wants to use, perhaps...

Can you explain in more detail what you mean by the token quickly
becoming
stale?  If I'm not mistaken, access tokens remain valid until the user
explicitly revokes them.

-Marc


[twitter-dev] Bug? Updates 140 characters return success with prior update payload

2009-10-17 Thread Marc Mims

Updates longer than 140 characters should be forcibly truncated
according to the documentation.  Instead, the update call returns with
a 200 status and the payload contains the prior update.

Has there been a change to the API or is this a bug.


[twitter-dev] Account reversion to May 2009 settings

2009-10-14 Thread Marc Mims

I'm the author/maintainer of Net::Twitter, the perl library for the
Twitter API.  I have an account, @net_twitter, I use to communicate
with the users of the Net::Twitter module.  Several times (most
recently, today), the account has been reverted to its state on or
about May 30, 2009.

I'm posting here in hopes of getting the attention of someone at
Twitter who can help.  I've reported the problem to Twitter support
each time it has occurred, but it always gets handled as a forgotten
password issue, which it is not.  The handling seems to be almost
entirely automated, so I'm not sure anyone has actually read the
details of my reports to support.

The original author/maintainer of Net::Twitter is Chris Thompson.  He
established the @net_twitter account.  When I rewrote the Net::Twitter
module, and Chris handed off maintenance of the Net::Twitter namespace
to me, he also changed the password of the @net_twitter account and
handed it off to me.

I changed the associated email address, password, url, and other
settings.  But every few weeks, Twitter reverts the account to the
values it had back in May.  That happened again, today, for at least
4th time.

In order to regain access to the account, I have to contact Chris each
time this happens and have him reset the password. Then I change the
email address, password, url, etc. all over, again.

The password reset isn't useful to me, since it doesn't send mail to
the address I saved in settings---it's sent to the address Chris
Thompson had set back in May.

What's causing the account reversion?  Can it be fixed?  Twitter,
please contact me.