Re: alpha test of a new service: Tweetpass

2009-01-08 Thread Swap

But won't OAuth put an end to this requirement anyway?

--Swap

On Jan 8, 6:04 am, Brian Hendrickson br...@openmicroblogger.com
wrote:
 On Jan 7, 1:00 pm, Chad Etzel jazzyc...@gmail.com wrote:

  By logging intohttp://tweetpass.com/api/doyou automatically store
  the password somewhere?  If so, how is it stored? encrypted?

 Yes, each user's twitter password is encrypted and stored in the SQL
 database. It's not on dreamhost, though :-) the server is physically
 controlled, in a high-end co-location facility in Portland.

 When an API call comes in with a disposable password, the twitter
 password is fetched from the database and used to make the call to the
 twitter.com API

 Also, the first time a disposable password is used, it is labeled with
 the incoming hostname and will only be good for that host. API events
 for that password are visible in the control panel.

  -- Brian


Dumping, Storing, and Displaying XML data with PHP and MySQL

2009-01-08 Thread thegreatbund...@gmail.com

Hey all,
Like I said in my previous post, what I'm trying to do is essentially
create a site that lists my friends_timeline. With that account, I'm
following a group of individuals in a particular industry.

Instead of hitting the Twitter server each time, I'm attempting to
store friends' tweets in a MySQL database and then display them to
visitors with PHP.

So, first off, I managed to authenticate and pull down the XML just
fine with curl.

As a test, I've stripped the data I want out and am printing it.


//print XML data (temporary)
$xml = simplexml_load_string ($str);
foreach ($xml-status as $status) {
print $status-created_at . br /\n; //timestamp
print $status-text . br /\n; //body
print $status-favorited . br /\n; //favorited (returns true or
false)
print $status-user-name . br /\n; //user's real name
print $status-user-description . br /\n; //user's description
print $status-user-profile_image_url . br /\n; //location of
user's profile pic
print $status-user-url . br /\n; //user's homepage
print $status-id . br /br /\n; //tweet single id
}


And that works just fine.

For the next step, I've created a database and set up its table
structure to match the XML data.

Each line below represents a column in the table. For readability,
I've matched the XML data I've stripped from friends_timeline to
what I set up as its corresponding column in the database.

//auto increment id (not matched with XML) (int)
//created_at - time (text)
//text - body (text)
//favorited - favorited (enum)
//name - name (text)
//description - description (text)
//profile_image_url - avatar (text)
//url - url (text)
//id - twitterid (int)


Now, the part I'm stuck on: (1) I'm not sure how to get that XML data
into my database. Do I have to pass it through an array first? Do I
have to convert it to strings, or have I done that already with $xml
= simplexml_load_string ($str)?

The other issue I'm not sure about: (2) When a visitor comes to the
site, he'll see a friends_timeline from the data in the database,
not directly from twitter's servers. But how do I keep pulling data
from the XML feed and load it into the database automatically? And
what's a good interval to repeat

After the data starts populating my database, I don't think I'll have
too much trouble writing queries to display the content. But I'll
cross that bridge when I come to it. :D

I know this isn't explicitly a twitter API question, and I hope its
not out of place here. But any advice is appreciated. And sorry for
any improper terminology or poor explanations; as you can probably
tell, my web coding acumen isn't extensive.

Thanks in advance for the help!

--Alex


Re: Twitter Users Pictures

2009-01-08 Thread Patrick Minton

Well, I am querying to update user stats (# of followers, location,  
etc), mostly because the app ranks the lawyers, and lawyers are a  
ridiculously competitive bunch that find it beyond cool that they get  
ranked.

So since I have the user object, might as well update the URL field in  
my DB too, right?


On Jan 7, 2009, at 2:57 PM, Stuart wrote:


 2009/1/7 Patrick Minton patr...@lexblog.com:
 Since you get user objects 100 at a time, you would have to query
 about an unreasonable number of users for this to be a problem imho.

 Lextweet.com follows about 700 lawyers.  This may grow to 2000.  20
 API calls an hour is a problem for the API?  I doubt it.  If it is,
 though, I'd be more than happy to reduce the frequency.

 My point was that there's no need to hit the API at all unless you get
 a 404 from the avatar URL. Why call the API if you don't need to?
 Seems like a pointless waste of resources to me.

 -Stuart

 -- 
 http://stut.net/

 On Jan 7, 2009, at 1:45 AM, Stuart wrote:


 2009/1/7 Patrick Minton patr...@lexblog.com:
 Yes, but once you have the url, why store the actual .png locally?
 Sure, if a user changes their profile image you may have a broken
 link, but
 you can update profile info every hour or so, thus making it a non-
 issue.

 I don't think Twitter would see it as a non-issue if your service  
 has
 more than a few users and you start requesting their details every
 hour. A better option is to attempt to download their avatar and  
 only
 request their profile and update it if you get a 404.

 -Stuart

 --
 http://stut.net/

 Patrick Minton
 IT Director
 LexBlog, Inc.
 +1 206 697 4548





Patrick Minton
IT Director
LexBlog, Inc.
+1 206 697 4548





Re: Total updates

2009-01-08 Thread Deepak Goyal
Is there any way to get the total no of direct messages.

Thanks
Deepak


On Wed, Jan 7, 2009 at 7:21 PM, Cameron Kaiser spec...@floodgap.com wrote:


  Is there a way to fetch the total updates a user did throught the
  twitter API? I just need the number? No other messages required!

 Look at the users/show method. The total updates are part of the fields.

 --
  personal:
 http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com *
 ckai...@floodgap.com
 -- LOADSTANDARD DISCLAIMER,8,1
 --



user_timeline with empty id returns... andiojeda

2009-01-08 Thread ups

I'm building an app that retrieves the public timeline from several
persons. During my tests I noticed something.

I called the API with the following URL:

http://twitter.com/statuses/user_timeline.json?count=2id=$username

If the $username is empty (I said I was still testing :P) then it will
request this

http://twitter.com/statuses/user_timeline.json?count=2id=

Which returns the timeline for andiojeda.

Not a killer bug.. but an error message is nicer.


The Page Parameter

2009-01-08 Thread BarryCarlyon

Greetings,

Just trying to figure out what the page parameter does

Im grabbing (and authenticating as me)

http://twitter.com/statuses/friends_timeline.xml?since_id=1104313400count=200page=1

I get stuff on page 1 but nothing on page 2, just wondering if

a) I can find out how many pages are returned, if more than 1,
b) what page actually does.

Yours

Barry Carlyon


user_timeline with empty id returns... andiojeda

2009-01-08 Thread ups

I'm building an app that retrieves several timelines from users.

In a very early stage of development, I found this feature:
If I call the API with the adress

http://twitter.com/statuses/user_timeline.json?count=2id=

the API returns the timeline for andiojeda.

This is a no killer, more of an heads up than a complaint. Still, an
error message would be nicer.


Re: Dumping, Storing, and Displaying XML data with PHP and MySQL

2009-01-08 Thread Chad Etzel

(1) You'll need to use something like mysql_query(...) to insert the
data (see http://www.tizag.com/mysqlTutorial/mysqlinsert.php for info,
or google around about it)

(2) If you're on a unix/linux system, use a cron job (see
http://www.aota.net/Script_Installation_Tips/cronhelp.php3 or use
google)

If you're on windows, you could probably create some sort of Scheduled
Task to call your script every so often.

As for the frequency I guess that depends on how old you are
willing to let your data get before pulling new data.  5 minutes? 10
minutes? 2 hours?  It's an authenticated request, so you are limited
(currently) to 100 per hour, so choose accordingly.

-Chad

On Thu, Jan 8, 2009 at 2:28 AM, thegreatbund...@gmail.com
thegreatbund...@gmail.com wrote:

 Hey all,
 Like I said in my previous post, what I'm trying to do is essentially
 create a site that lists my friends_timeline. With that account, I'm
 following a group of individuals in a particular industry.

 Instead of hitting the Twitter server each time, I'm attempting to
 store friends' tweets in a MySQL database and then display them to
 visitors with PHP.

 So, first off, I managed to authenticate and pull down the XML just
 fine with curl.

 As a test, I've stripped the data I want out and am printing it.

 
 //print XML data (temporary)
 $xml = simplexml_load_string ($str);
 foreach ($xml-status as $status) {
print $status-created_at . br /\n; //timestamp
print $status-text . br /\n; //body
print $status-favorited . br /\n; //favorited (returns true or
 false)
print $status-user-name . br /\n; //user's real name
print $status-user-description . br /\n; //user's description
print $status-user-profile_image_url . br /\n; //location of
 user's profile pic
print $status-user-url . br /\n; //user's homepage
print $status-id . br /br /\n; //tweet single id
 }
 

 And that works just fine.

 For the next step, I've created a database and set up its table
 structure to match the XML data.

 Each line below represents a column in the table. For readability,
 I've matched the XML data I've stripped from friends_timeline to
 what I set up as its corresponding column in the database.
 
 //auto increment id (not matched with XML) (int)
 //created_at - time (text)
 //text - body (text)
 //favorited - favorited (enum)
 //name - name (text)
 //description - description (text)
 //profile_image_url - avatar (text)
 //url - url (text)
 //id - twitterid (int)
 

 Now, the part I'm stuck on: (1) I'm not sure how to get that XML data
 into my database. Do I have to pass it through an array first? Do I
 have to convert it to strings, or have I done that already with $xml
 = simplexml_load_string ($str)?

 The other issue I'm not sure about: (2) When a visitor comes to the
 site, he'll see a friends_timeline from the data in the database,
 not directly from twitter's servers. But how do I keep pulling data
 from the XML feed and load it into the database automatically? And
 what's a good interval to repeat

 After the data starts populating my database, I don't think I'll have
 too much trouble writing queries to display the content. But I'll
 cross that bridge when I come to it. :D

 I know this isn't explicitly a twitter API question, and I hope its
 not out of place here. But any advice is appreciated. And sorry for
 any improper terminology or poor explanations; as you can probably
 tell, my web coding acumen isn't extensive.

 Thanks in advance for the help!

 --Alex



Re: The Page Parameter

2009-01-08 Thread Chad Etzel

Perhaps there are no more than 200 tweets since id 1104313400 so the
next page will be blank.  Try requesting w/o the since_id and see
what happens.

-Chad

On Thu, Jan 8, 2009 at 8:38 AM, BarryCarlyon barrycarl...@gmail.com wrote:

 Greetings,

 Just trying to figure out what the page parameter does

 Im grabbing (and authenticating as me)

 http://twitter.com/statuses/friends_timeline.xml?since_id=1104313400count=200page=1

 I get stuff on page 1 but nothing on page 2, just wondering if

 a) I can find out how many pages are returned, if more than 1,
 b) what page actually does.

 Yours

 Barry Carlyon


Re: Twitter Users Pictures

2009-01-08 Thread greg schoen

It's is good practice to both save the profile_image_url data from the
API and save the image locally. This way, if the profile_image_url
changes, you have a trigger to recache the image to your local site. I
find that page loads are much faster when you can control the images
that come through.

A good example is that, since Twitter allows avatar images of up to
700k, you may find that a user has saved a 600k animated JPG file,
that you might want to convert to a static non-animated version. 700k
can spike your traffic, if it's taking up more than all the other
images combined.

Maybe Alex can answer this, but is Twitter going to be clamping down
on avatar images? 700k just seems excessive, when the average is 2k
and under.

-Greg

On Thu, Jan 8, 2009 at 1:12 AM, Patrick Minton patr...@lexblog.com wrote:

 Well, I am querying to update user stats (# of followers, location,
 etc), mostly because the app ranks the lawyers, and lawyers are a
 ridiculously competitive bunch that find it beyond cool that they get
 ranked.

 So since I have the user object, might as well update the URL field in
 my DB too, right?


 On Jan 7, 2009, at 2:57 PM, Stuart wrote:


 2009/1/7 Patrick Minton patr...@lexblog.com:
 Since you get user objects 100 at a time, you would have to query
 about an unreasonable number of users for this to be a problem imho.

 Lextweet.com follows about 700 lawyers.  This may grow to 2000.  20
 API calls an hour is a problem for the API?  I doubt it.  If it is,
 though, I'd be more than happy to reduce the frequency.

 My point was that there's no need to hit the API at all unless you get
 a 404 from the avatar URL. Why call the API if you don't need to?
 Seems like a pointless waste of resources to me.

 -Stuart

 --
 http://stut.net/

 On Jan 7, 2009, at 1:45 AM, Stuart wrote:


 2009/1/7 Patrick Minton patr...@lexblog.com:
 Yes, but once you have the url, why store the actual .png locally?
 Sure, if a user changes their profile image you may have a broken
 link, but
 you can update profile info every hour or so, thus making it a non-
 issue.

 I don't think Twitter would see it as a non-issue if your service
 has
 more than a few users and you start requesting their details every
 hour. A better option is to attempt to download their avatar and
 only
 request their profile and update it if you get a 404.

 -Stuart

 --
 http://stut.net/

 Patrick Minton
 IT Director
 LexBlog, Inc.
 +1 206 697 4548





 Patrick Minton
 IT Director
 LexBlog, Inc.
 +1 206 697 4548







-- 
greg.sch...@gmail.com
920.941.0399


Re: The Page Parameter

2009-01-08 Thread dougw

That call works for me.  Using page=2 does indeed give me the next
page or results.

Are you sure you have a second page of results? One way to know if you
don't is if there are less than the count parameter results returned.
For instance, you have count=200. If only 152 updates are included in
the results, you know that you don't have another page. You should
receive an empty statuses type=array/statuses if you are on a
page past where you have any results.



On Jan 8, 8:38 am, BarryCarlyon barrycarl...@gmail.com wrote:
 Greetings,

 Just trying to figure out what the page parameter does

 Im grabbing (and authenticating as me)

 http://twitter.com/statuses/friends_timeline.xml?since_id=1104313400;...

 I get stuff on page 1 but nothing on page 2, just wondering if

 a) I can find out how many pages are returned, if more than 1,
 b) what page actually does.

 Yours

 Barry Carlyon


Re: The Page Parameter

2009-01-08 Thread dougw

I didn't realize earlier you asked what it does so let me explain the
pagination functionality. Let's say you have 401 messages from friends
in your timeline. As per the API you can only get 200 statuses back
with each request.

So if you make a request with page=1count=200 you will get the first
200 statuses from your friends_timeline
If you make another request with page=2count=200 you will get
statuses number 201-400 from your friends_timeline
If you then make a final request to page=3count=200 you will get the
final (number 401) status from the timeline.

When you receive less statuses than you requested you know you are on
your last page.



On Jan 8, 8:38 am, BarryCarlyon barrycarl...@gmail.com wrote:
 Greetings,

 Just trying to figure out what the page parameter does

 Im grabbing (and authenticating as me)

 http://twitter.com/statuses/friends_timeline.xml?since_id=1104313400;...

 I get stuff on page 1 but nothing on page 2, just wondering if

 a) I can find out how many pages are returned, if more than 1,
 b) what page actually does.

 Yours

 Barry Carlyon


Image Error on Site

2009-01-08 Thread greg schoen

I'm noticing that on the image for user: mevasquez55  The image is not
displaying on the site, however, clicking through to the image from
the site will link you to the correct image. Only reason that I'm
posting this to the API list is that the response image url from the
API is coming up wrong, possibly because the image does not exist.
Please correct me if this needs to go somewhere else.

-Greg

-- 
greg.sch...@gmail.com
920.569-9873


Re: Twitter Users Pictures

2009-01-08 Thread dougw

I too would appreciate someone from Twitter giving us a best practice
here. I'd prefer not to cache images locally (lazy) and only store the
url. But how does the company feel about paying for bandwidth if I
just request user images from the S3 URL in third-party apps?

On Jan 8, 10:23 am, greg schoen greg.sch...@gmail.com wrote:
 It's is good practice to both save the profile_image_url data from the
 API and save the image locally. This way, if the profile_image_url
 changes, you have a trigger to recache the image to your local site. I
 find that page loads are much faster when you can control the images
 that come through.

 A good example is that, since Twitter allows avatar images of up to
 700k, you may find that a user has saved a 600k animated JPG file,
 that you might want to convert to a static non-animated version. 700k
 can spike your traffic, if it's taking up more than all the other
 images combined.

 Maybe Alex can answer this, but is Twitter going to be clamping down
 on avatar images? 700k just seems excessive, when the average is 2k
 and under.

 -Greg



 On Thu, Jan 8, 2009 at 1:12 AM, Patrick Minton patr...@lexblog.com wrote:

  Well, I am querying to update user stats (# of followers, location,
  etc), mostly because the app ranks the lawyers, and lawyers are a
  ridiculously competitive bunch that find it beyond cool that they get
  ranked.

  So since I have the user object, might as well update the URL field in
  my DB too, right?

  On Jan 7, 2009, at 2:57 PM, Stuart wrote:

  2009/1/7 Patrick Minton patr...@lexblog.com:
  Since you get user objects 100 at a time, you would have to query
  about an unreasonable number of users for this to be a problem imho.

  Lextweet.com follows about 700 lawyers.  This may grow to 2000.  20
  API calls an hour is a problem for the API?  I doubt it.  If it is,
  though, I'd be more than happy to reduce the frequency.

  My point was that there's no need to hit the API at all unless you get
  a 404 from the avatar URL. Why call the API if you don't need to?
  Seems like a pointless waste of resources to me.

  -Stuart

  --
 http://stut.net/

  On Jan 7, 2009, at 1:45 AM, Stuart wrote:

  2009/1/7 Patrick Minton patr...@lexblog.com:
  Yes, but once you have the url, why store the actual .png locally?
  Sure, if a user changes their profile image you may have a broken
  link, but
  you can update profile info every hour or so, thus making it a non-
  issue.

  I don't think Twitter would see it as a non-issue if your service
  has
  more than a few users and you start requesting their details every
  hour. A better option is to attempt to download their avatar and
  only
  request their profile and update it if you get a 404.

  -Stuart

  --
 http://stut.net/

  Patrick Minton
  IT Director
  LexBlog, Inc.
  +1 206 697 4548

  Patrick Minton
  IT Director
  LexBlog, Inc.
  +1 206 697 4548

 --
 greg.sch...@gmail.com
 920.941.0399


Re: Total updates

2009-01-08 Thread dougw

A cursory glance at the API docs makes it appear as if you'd have to
page through all of your DMs and count, but the fact that Twitter puts
the number of DMs you have on your /home page suggests that value is
given some where though I've never seen it.

In the very least, the number of directs is obviously something that
Twitter keeps cached/on hand. If I haven't missed it somewhere, and
there is no API-based way to receive this value, you can always ask
for a method ;)

@dougw

On Jan 7, 10:33 pm, Deepak Goyal hrdeepa...@gmail.com wrote:
 Is there any way to get the total no of direct messages.

 Thanks
 Deepak

 On Wed, Jan 7, 2009 at 7:21 PM, Cameron Kaiser spec...@floodgap.com wrote:

   Is there a way to fetch the total updates a user did throught the
   twitter API? I just need the number? No other messages required!

  Look at the users/show method. The total updates are part of the fields.

  --
   personal:
 http://www.cameronkaiser.com/--
   Cameron Kaiser * Floodgap Systems *www.floodgap.com*
  ckai...@floodgap.com
  -- LOADSTANDARD DISCLAIMER,8,1
  --


Re: The Page Parameter

2009-01-08 Thread BarryCarlyon

That makes sense, thanks :-D

On Jan 8, 3:31 pm, dougw igu...@gmail.com wrote:
 I didn't realize earlier you asked what it does so let me explain the
 pagination functionality. Let's say you have 401 messages from friends
 in your timeline. As per the API you can only get 200 statuses back
 with each request.

 So if you make a request with page=1count=200 you will get the first
 200 statuses from your friends_timeline
 If you make another request with page=2count=200 you will get
 statuses number 201-400 from your friends_timeline
 If you then make a final request to page=3count=200 you will get the
 final (number 401) status from the timeline.

 When you receive less statuses than you requested you know you are on
 your last page.

 On Jan 8, 8:38 am, BarryCarlyon barrycarl...@gmail.com wrote:

  Greetings,

  Just trying to figure out what the page parameter does

  Im grabbing (and authenticating as me)

 http://twitter.com/statuses/friends_timeline.xml?since_id=1104313400;...

  I get stuff on page 1 but nothing on page 2, just wondering if

  a) I can find out how many pages are returned, if more than 1,
  b) what page actually does.

  Yours

  Barry Carlyon


Re: alpha test of a new service: Tweetpass

2009-01-08 Thread Alex Payne

Ideally, yes.

On Thu, Jan 8, 2009 at 04:10, Swap rh.swar...@gmail.com wrote:

 But won't OAuth put an end to this requirement anyway?

 --Swap

 On Jan 8, 6:04 am, Brian Hendrickson br...@openmicroblogger.com
 wrote:
 On Jan 7, 1:00 pm, Chad Etzel jazzyc...@gmail.com wrote:

  By logging intohttp://tweetpass.com/api/doyou automatically store
  the password somewhere?  If so, how is it stored? encrypted?

 Yes, each user's twitter password is encrypted and stored in the SQL
 database. It's not on dreamhost, though :-) the server is physically
 controlled, in a high-end co-location facility in Portland.

 When an API call comes in with a disposable password, the twitter
 password is fetched from the database and used to make the call to the
 twitter.com API

 Also, the first time a disposable password is used, it is labeled with
 the incoming hostname and will only be good for that host. API events
 for that password are visible in the control panel.

  -- Brian




-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x


Re: HTML payload when expecting JSON response

2009-01-08 Thread Alex Payne

Someone from Twitter did chime in - Matt works here. I'm sure he's
investigating if he said he's investigating. Hang tight!

On Thu, Jan 8, 2009 at 10:19, FrankieShakes frankma...@gmail.com wrote:

 Just wondering if there has been any progress on this issue... Can
 anyone at Twitter chime in?

 For what it's worth... I'm still experiencing the problem.  Just had
 it happen again this morning.


 Thanks,
 -f

 On Nov 27 2008, 7:51 pm, FrankieShakes frankma...@gmail.com wrote:
 Hey Matt,

 I received the error message again this morning.  It always returns
 the same error message in the HTML body:

 ---
 span style=font-size:1.8em; font-weight:boldSomething is
 technically wrong./span
 br /
 div style=font-size:1.2em;margin-top:2px;color:#b6b6a3
 Thanks for noticing—we're  going to fix it up and  have things
 back to normal soon.
 /div
 br /
 p style=margin-bottom:10px;text-align:centerimg src=http://
 static.twitter.com/images/please_fix.png //p
 ---

 I suspect nobody's around at Twitter during Thanksgiving ;)  Hoping
 you can give me some feedback when you're back from the holiday.

 Happy Thanksgiving!
 -f

 On Nov 24, 1:59 pm,FrankieShakesfrankma...@gmail.com wrote:

  Hey Matt,

  Thanks for looking into it for me.

  I went back to my system logs and actually did find a case where it
  happened to me:

 http://pastebin.com/m2e1ae375

  If you look at the timestamp, this was on Nov. 13 @ 14:53:20 (EST).  I
  also found other occurrences:

  - 2008-11-12 16:54:16 (EST)
  - 2008-11-18 15:54:23 (EST)

  Maybe this will give you some further insight.  In my case, however,
  the server returned a 502 instead of a 500 serve error.

  Let me know if you come across anything.  I'd love to get this
  resolved.

  Thanks again,
  Frank

  On Nov 24, 12:51 pm, Matt Sanford m...@twitter.com wrote:

   Hi Frank,

Nothing comes right to mind. I'll start looking through logs and
   see if I can find anything. Is the issue always with /favorites.json?
   Do you have a general idea when this started, or when you started
   receiving reports of it?

   — Matt Sanford

   On Nov 24, 2008, at 09:45 AM,FrankieShakeswrote:

Hey Matt,

Unfortunately, I haven't been able to reproduce this myself.  I have,
however, had quite a few users email me with their logs and each of
them has the exact same payload.

Any ideas?

Thanks,
Frank

On Nov 24, 12:31 pm, Matt Sanford m...@twitter.com wrote:
Hi Frank,

 A 500 is normally an error on the Twitter side. Can you provide
an example account where you're seeing this?

Thanks;
   — Matt (@mzsanford)

On Nov 24, 2008, at 09:26 AM,FrankieShakeswrote:

Hey everyone,

I've been receiving quite a few reports lately where users are
experiencing issue with requesting the timeline.  I've asked for log
reports, and each and every single one of them includes the
following:

   http://pastebin.com/m36523b99

I'm hoping someone could shed light on the situation... I'm not sure
what would be causing this (other than load on Twitter's servers).
The only thing that concerns me is that I don't know whether other
clients are experiencing the same issue -- I'm thinking not.

Any help would be greatly appreciated.

Thanks,
Frank




-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x


Re: HTML payload when expecting JSON response

2009-01-08 Thread Matt Sanford

Hi Frank,

The static HTML you're seeing if from our Apache instance to it  
is static. I need to track down what request you sent so I can find  
the root cause. I'll check into 500s from November 27th, but as you  
can expect the log has a fair number due to scripts trying every URL  
under the sun. If you have received a 500 recently, and know the URL  
you requested, it would be most helpful.
As for the 502, that's a different error and caused when we can't  
find an available mongrel to handle your request. We have fewer of  
those than ever before but at peak times I still see a few creep  
trhough. We're doing everything we can to fix them.


— Matt The other-other API guy Sanford / @mzsanford

On Jan 8, 2009, at 10:19 AM, FrankieShakes wrote:


Just wondering if there has been any progress on this issue... Can
anyone at Twitter chime in?

For what it's worth... I'm still experiencing the problem.  Just had
it happen again this morning.


Thanks,
-f

On Nov 27 2008, 7:51 pm, FrankieShakes frankma...@gmail.com wrote:

Hey Matt,

I received the error message again this morning.  It always returns
the same error message in the HTML body:

---
span style=font-size:1.8em; font-weight:boldSomething is
technically wrong./span
br /
div style=font-size:1.2em;margin-top:2px;color:#b6b6a3
Thanks for noticing—we're  going to fix it up and  have things
back to normal soon.
/div
br /
p style=margin-bottom:10px;text-align:centerimg src=http://
static.twitter.com/images/please_fix.png //p
---

I suspect nobody's around at Twitter during Thanksgiving ;)  Hoping
you can give me some feedback when you're back from the holiday.

Happy Thanksgiving!
-f

On Nov 24, 1:59 pm,FrankieShakesfrankma...@gmail.com wrote:


Hey Matt,



Thanks for looking into it for me.



I went back to my system logs and actually did find a case where it
happened to me:



http://pastebin.com/m2e1ae375


If you look at the timestamp, this was on Nov. 13 @ 14:53:20  
(EST).  I

also found other occurrences:



- 2008-11-12 16:54:16 (EST)
- 2008-11-18 15:54:23 (EST)



Maybe this will give you some further insight.  In my case, however,
the server returned a 502 instead of a 500 serve error.



Let me know if you come across anything.  I'd love to get this
resolved.



Thanks again,
Frank



On Nov 24, 12:51 pm, Matt Sanford m...@twitter.com wrote:



Hi Frank,


 Nothing comes right to mind. I'll start looking through logs  
and
see if I can find anything. Is the issue always with / 
favorites.json?

Do you have a general idea when this started, or when you started
receiving reports of it?



— Matt Sanford



On Nov 24, 2008, at 09:45 AM,FrankieShakeswrote:



Hey Matt,


Unfortunately, I haven't been able to reproduce this myself.  I  
have,
however, had quite a few users email me with their logs and each  
of

them has the exact same payload.



Any ideas?



Thanks,
Frank



On Nov 24, 12:31 pm, Matt Sanford m...@twitter.com wrote:

Hi Frank,


 A 500 is normally an error on the Twitter side. Can you  
provide

an example account where you're seeing this?



Thanks;
   — Matt (@mzsanford)



On Nov 24, 2008, at 09:26 AM,FrankieShakeswrote:



Hey everyone,



I've been receiving quite a few reports lately where users are
experiencing issue with requesting the timeline.  I've asked  
for log

reports, and each and every single one of them includes the
following:



http://pastebin.com/m36523b99


I'm hoping someone could shed light on the situation... I'm  
not sure
what would be causing this (other than load on Twitter's  
servers).
The only thing that concerns me is that I don't know whether  
other

clients are experiencing the same issue -- I'm thinking not.



Any help would be greatly appreciated.



Thanks,
Frank




API Changes for January 7, 2009

2009-01-08 Thread Alex Payne

(Apologies for the belated notification)

Fixed: source parameters specified when posting on the web (for
example, as part of a link from a Tweet This/Share This On Twitter
button) were being ignored.

Fixed: /friendship/exists.json was returning true and false as
strings, not boolean literals, as they should in a proper JSON
response.

-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x


Question RE: IP whitelisting

2009-01-08 Thread Patrick Minton

If I request to whitelist an IP range, does it matter which twitter  
account I use for authentication?  Can I switch back and forth among  
accounts?


Patrick Minton
IT Director
LexBlog, Inc.
+1 206 697 4548





Re: Alex Payne (API dev lead) talks security

2009-01-08 Thread dougw

Hope I didn't step on any toes then. I just get the feeling that a lot
people don't get to proper understanding of how hard some of these
problems are to solve. Not only technologically but also from the
user, third-party, and resource perspectives.

On Jan 8, 3:35 pm, Alex Payne a...@twitter.com wrote:
 Thanks for pointing that out for folks, Doug. It's not an official
 resource, of course - there's both fact and opinion expressed in that
 conversation. That's why I didn't bring it up here.

 I hope it gives people a good sense of why OAuth has taken so long,
 what some potential issues with it might be, and that we're pushing
 forward in good faith that the community will make the experience the
 best it can be.

 On Thu, Jan 8, 2009 at 12:30, dougw igu...@gmail.com wrote:

  Developers,
  Alex Payne sat down and discussed security recently. There's been a
  lot of discussion here on the subject recently so I'm passing along
  the link:

 http://citizengarden.com/2009/01/08/episode-10-phish-my-phail-whale/

  Well worth the listen.

  @dougw

 --
 Alex Payne - API Lead, Twitter, Inc.http://twitter.com/al3x


Re: jquery bug or twitter bug? on api call to /users/show/[username].json

2009-01-08 Thread Ivan

Thanks Matt, that really helped explain things.

I tried to use a straight $.ajax(...).ajaxError to catch the error.

It didn't work.

My solution was to toggle a loader gif before the transaction, set the
timeout in $.ajax to 4000ms, and made a setTimeout at 4100ms to a
function that checked if the loader gif was still shown. If so, it
reported a problem to the user.

This is obviously a very, very ugly hack. But it worked. :D

Look for an update soon about what this little project is all about at
my twitter stream: http://twitter.com/tipjoy

The final mini app that we've made will be a pretty good example of
how to very quickly extract info from the twitter API using jquery.

Ivan
http://tipjoy.com

On Jan 7, 11:07 am, Matt Sanford m...@twitter.com wrote:
 Hi Ivan,

      The jQuery getJSON replaces the trailing ? with a function name  
 like jsonp4728701093601231 [1]. To test you need to use something more  
 like:

 $ curl 'http://twitter.com/users/show/someBadUsername.json?callback=foo'
 foo({request:\/users\/show\/someBadUsername.json?
 callback=foo,error:Not found})

      It looks like the Twitter API is working correctly. One thing to  
 note is that the Twitter API is returning HTTP 404. I am pretty sure  
 the jQuery getJSON method is only calling your function on success  
 (HTTP 200). I'm not totally sure but the jQuery ajaxError event  
 handler may help do what you need.

 Thanks;
    — Matt Sanford / @mzsanford

 [1] - jsonp + currentTimeMillis

 On Jan 7, 2009, at 07:48 AM, Ivan wrote:



  Hi,

  I'm cofounder of Tipjoy - we just made payment on twitter. Check it
  out:http://tipjoy.com/twitter

  We have a fun project related to this that I'm working on right now.

  I'm using jquery to parse the twitter account info from the API.
  Disclaimer: I'm learning javascript JIT.

  There is either a bug in my javascript, or the return from the twitter
  API is wrong.

  Here is some simplified code:

  $(document).ready(function(){
     var url = http://twitter.com/users/show/; + [the username] +
  .json?callback=?;
     $.getJSON(url,
         function(data){
             if( data.error ){
                 alert(username doesn't exist)
             }
             else{
                 alert(that username exists)
             }
         }
     );
  });

  This code uses jquery's getJSON to grab the account info for a given
  username.

  The return for a correct username is:
  ({...});

  That wrapping is to pass it to the callback unnamed function.

  But this code doesn't work for a username that doesn't exist. The
  function doesn't even get called, and the alert doesn't show up.

  Putting this is a browser
 http://twitter.com/users/show/someBadUsername.json?callback=?

  Returns:
  {request:\/users\/show\/someBadUsername.json?
  callback=?,error:Not found}

  Should that be wrapped in ({...}); ? Is that a bug on twitter's side?

  Or is there something I'm doing wrong in jquery?

  I looked at the code for this project, and it looks like they are
  using jquery to access summize in the same way I'm grabbing from the
  twitter api.
 http://tweet.seaofclouds.com/
 http://github.com/seaofclouds/tweet/tree/master/javascripts/jquery.tw...

  Any help would be greatly appreciated.

  Thanks,
  Ivan
 http://tipjoy.com


create friendship from URL, NON API Method?

2009-01-08 Thread Peter Denton
Hello,
I have a third party site and want to connect twitter users. I am not having
them authenticate, its more of a listing service.

Say I have a button that says follow by a profile on my site, and I want
to just point at a URL on twitter that would create a friendship after they
log in on twitter.

So again, 1. I am on the third party site, 2. I click a link pointing at
some URL like http://twitter.com/friendships/create/al3x, 3. I login to
twitter on twitter.com and 4. I am now on twitter and a friendship has
occured

Thanks!


Re: create friendship from URL, NON API Method?

2009-01-08 Thread Chad Etzel

I don't think this is supported b/c friendship creation must be
initiated by a POST request, meaning that some deliberate action must
be taken on the part of the user (e.g. clicking a Follow button on
twitter's site).  I'm pretty sure this is intentional as it was
changed to act this way to prevent automatic follow spamming that was
occurring some time ago.

I think the best you can do is just point them to the user's profile
on twitter and hope that they login and click follow.

-Chad

On Thu, Jan 8, 2009 at 5:35 PM, Peter Denton petermden...@gmail.com wrote:
 Hello,
 I have a third party site and want to connect twitter users. I am not having
 them authenticate, its more of a listing service.

 Say I have a button that says follow by a profile on my site, and I want
 to just point at a URL on twitter that would create a friendship after they
 log in on twitter.

 So again, 1. I am on the third party site, 2. I click a link pointing at
 some URL like http://twitter.com/friendships/create/al3x, 3. I login to
 twitter on twitter.com and 4. I am now on twitter and a friendship has
 occured

 Thanks!



Re: create friendship from URL, NON API Method?

2009-01-08 Thread Petermdenton


Thanks jazzy


On Jan 8, 2009, at 2:42 PM, Chad Etzel jazzyc...@gmail.com wrote:



I don't think this is supported b/c friendship creation must be
initiated by a POST request, meaning that some deliberate action must
be taken on the part of the user (e.g. clicking a Follow button on
twitter's site).  I'm pretty sure this is intentional as it was
changed to act this way to prevent automatic follow spamming that was
occurring some time ago.

I think the best you can do is just point them to the user's profile
on twitter and hope that they login and click follow.

-Chad

On Thu, Jan 8, 2009 at 5:35 PM, Peter Denton  
petermden...@gmail.com wrote:

Hello,
I have a third party site and want to connect twitter users. I am  
not having

them authenticate, its more of a listing service.

Say I have a button that says follow by a profile on my site, and  
I want
to just point at a URL on twitter that would create a friendship  
after they

log in on twitter.

So again, 1. I am on the third party site, 2. I click a link  
pointing at
some URL like http://twitter.com/friendships/create/al3x, 3. I  
login to
twitter on twitter.com and 4. I am now on twitter and a friendship  
has

occured

Thanks!



Re: create friendship from URL, NON API Method?

2009-01-08 Thread Nicole Simon
On Thu, Jan 8, 2009 at 11:42 PM, Chad Etzel jazzyc...@gmail.com wrote:

 I think the best you can do is just point them to the user's profile
 on twitter and hope that they login and click follow.


You can do better.

Use the 'tweet this' code examples, programm a 'follow $username'
message and explain somewhere that sending out this message
will follow that particular user and that this message will not be
tweetet out.


hth
Nicole

ps: Resist the temptation to build something inbetween like MrTweet so
you can track the actions - people do not like being tracked  and
will circumvent this step.


-- 
Suche Beta-Tester für Experiment:
Journalisten suchen Blogger - http://bloxpert.de/

Kontakt:
http://twitter.com/NicoleSimon // http://mit140zeichen.de/
http://crueltobekind.org // http://beissholz.de

skype: nicole.simon / mailto:nee...@gmail.com
phone: +49 451 899 75 03 / mobile: +49 179 499 7076


Re: create friendship from URL, NON API Method?

2009-01-08 Thread Chad Etzel

On Thu, Jan 8, 2009 at 6:00 PM, Nicole Simon nee...@gmail.com wrote:


 On Thu, Jan 8, 2009 at 11:42 PM, Chad Etzel jazzyc...@gmail.com wrote:

 I think the best you can do is just point them to the user's profile
 on twitter and hope that they login and click follow.

 You can do better.

 Use the 'tweet this' code examples, programm a 'follow $username'
 message and explain somewhere that sending out this message
 will follow that particular user and that this message will not be
 tweetet out.



Interesting idea.  It still requires an action on the user's part
(clicking Update in this case) and might be more confusing than just
clicking follow on somebody else's profile.  In any case, it would
work also.

-Chad



 ps: Resist the temptation to build something inbetween like MrTweet so
 you can track the actions - people do not like being tracked  and
 will circumvent this step.


 --
 Suche Beta-Tester für Experiment:
 Journalisten suchen Blogger - http://bloxpert.de/

 Kontakt:
 http://twitter.com/NicoleSimon // http://mit140zeichen.de/
 http://crueltobekind.org // http://beissholz.de

 skype: nicole.simon / mailto:nee...@gmail.com
 phone: +49 451 899 75 03 / mobile: +49 179 499 7076





Twitter Badges Requiring Auth

2009-01-08 Thread Damon C

Assuming you guys are aware, but just in case. Seems a change to the
API (to remedy the privacy leak, I'm assuming) is now causing Twitter
badges on blogs to request API auth.


Re: Twitter Badges Requiring Auth

2009-01-08 Thread Alex Payne

Yes, we're pushing out a fix for this shortly.

On Thu, Jan 8, 2009 at 15:41, Damon C d.lifehac...@gmail.com wrote:

 Assuming you guys are aware, but just in case. Seems a change to the
 API (to remedy the privacy leak, I'm assuming) is now causing Twitter
 badges on blogs to request API auth.




-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x


Twitter badges prompting for Basic Auth login

2009-01-08 Thread Alex Payne

This is a bug, deployed as part of a related fix to our handling of
web sessions vs API authentication. A fix is pending deploy while we
resolve some issues with our cluster's internal network.

-- 
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x