Re: Twitter Logout API is not working

2008-12-24 Thread Alex Payne

The /account/end_session method is only useful if you're making
requests from an application hosted in a web browser that will
establish a persistent session with your HTTP Basic Auth credentials.
For more typical applications (desktop or server-to-server), it's
unnecessary, as there's no concept of a session and every request
requires authentication.

On Tue, Dec 23, 2008 at 21:27, vinay vinay0123456...@gmail.com wrote:

 I would like to know, is there any API to logout or end the session.

 Illustration.

 I'm used the following API to check credentials and logged in to
 twitter.
 http://twitter.com/account/verify_credentials.xml

 after logged in I have used the following API to end the session.

 http://twitter.com/account/end_session.xml

 but it doesn't seems to be work. Please let me know if there is any
 other solution.

 Thanks in advance.





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


Re: How might I change the URL for my source?

2008-12-24 Thread Alex Payne

Please email me off-list with your change.

On Tue, Dec 23, 2008 at 22:17, Dustin dsalli...@gmail.com wrote:


  I registered a source a while back with a rather dumb URL.  How
 might I go about requesting it to be changed?




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


Re: python/twisted API implementation

2008-12-24 Thread Alex Payne

A winning project name if ever I've read one.  I've added it to the
Libraries page of the API Wiki: http://apiwiki.twitter.com/Libraries

On Tue, Dec 23, 2008 at 22:23, Dustin dsalli...@gmail.com wrote:


  I've got a twitter API implementation in twisted in case anyone's
 interested:

  http://github.com/dustin/twitty-twister




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


Re: roll up twitter conversations

2008-12-24 Thread JakeS

If it reaches a protected status, it obviously cannot proceed fetching
more of the conversation.  You may want to provide some sort of
indicator of that if your UI allows it.

And no, the search api sadly doesn't contain the in_reply_to_status_id
field.  My UI only shows the Show Conversation menu item if that
field is available, so it's just not an option when showing search
results.  I really hope they add it to the search API soon -- it would
allow me to do a search for anything @SomeoneWhoAskedAQuestion and
pick out other people's answers, which would be very useful.

On Dec 24, 12:19 am, Shahid Faiz shahid.f...@gmail.com wrote:
 Nice approach to get conversations. What you do if that status is from
 protected profile and that person is not friend? What about results returned
 from search, I think these results don't have in_reply_to_status_id?

 Thanks,
 Shahid

 On Wed, Dec 24, 2008 at 9:46 AM, JakeS jakesteven...@gmail.com wrote:

  My application currently does it by looking at the
  in_reply_to_status_id on the current status, then calling
 http://twitter.com//statuses/show/WHATEVERTHATIDWAS.xmlto get that
  status.  If that one has a in_reply_to_status_id, it fetches that
  one.  It keeps going until it reaches a status without it.

  On Dec 23, 1:07 pm, vonnegut_fan petermden...@gmail.com wrote:
   Hello,
   I am building a third party twitter app and want to show tweets in
   conversations, meaning if a tweet is a reply, I display those the
   same way that search.twitter.com displays conversations, with the
   reply beneath.

   I just wanted to ask before I start from scratch if there is a semi-
   standard approach people are following to achieve this. I noticed in
   twitter they use the thread URL schema, but when I look at that, it
   comes across as HTML, not as XML.

   But any advice you have would be greatly appreciated.

   Thanks,
   Peter


Re: Expect Header Issue for .NET developers

2008-12-24 Thread Carlos

Thanks Jake, I was getting the same errors.

Is this expected behavior now for Twitter or is this a bug in the new
Twitter release (Not supporting the Expect: Continue header). I'm
writing a multi-service Windows Mobile application and I'd prefer not
changing global http connection settings if I don't have to.

 Thanks for helping out with this tip, Jake.

 On Tue, Dec 23, 2008 at 20:31, JakeS jakesteven...@gmail.com wrote:

  Looks like twitter is updating something and their servers are
  returning error 417 for a lot of requests.  I looked into it and found
  that .NET automatically includes an Expect header containing 100-
  continue on every request unless you specifically tell it not to.

  So for any .NET devs having trouble, you can set
  System.Net.ServicePointManager.Expect100Continue = false before making
  your request to get past this issue.

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


Re: Date Format: ex: about 2 hours ago

2008-12-24 Thread Matthew

 All of the clients
and the web post friendly things like about 2 hours ago. Can anyone
provide a standard routine for converting the pure date element into
these english strings?

take a look at the way Rails does it as well,
http://github.com/rails/rails/tree/master/actionpack/lib/action_view/helpers/date_helper.rb

It's quite a common thing,
so perhaps you should look at the source for Struts,
or some similar java framework,
see if you can steal the code directly from there.


Re: Expect Header Issue for .NET developers

2008-12-24 Thread Cameron Kaiser

 Is this expected behavior now for Twitter or is this a bug in the new
 Twitter release (Not supporting the Expect: Continue header). I'm
 writing a multi-service Windows Mobile application and I'd prefer not
 changing global http connection settings if I don't have to.

Strictly speaking, according to the HTTP spec, it was a bug to *accept*
Expect 100-continue and *not* return a 417 if you weren't prepared to handle
it. See RFC 2616, 14.20. Thus, Twitter's Apache was buggy *before*, but not
now.

There are arguments for shooting first and asking questions later (i.e.,
send Expect: headers all the time even if the remote server doesn't handle
it right), but clients that shoot first should be prepared to retry the
request without Expect: because there are still many servers that don't
know what to do with it. There are also ambiguous situations with servers
that don't understand the header at all and just ignore it; see Section
8.2.3.

-- 
 personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
-- Ninety-nine percent of lawyers give the rest a bad name. ---


Search near returning incomplete results

2008-12-24 Thread TCI

Hello,
I am trying this search call:

ozacr near:Costa Rica within:100mi

but it does not return many of the results I get with just

ozacr

... despite the users having Location = Costa Rica

such as

(1075899595)  OzaCR: *uta.. Esta tan frio Moravia q no me puedo
dormir :-(
(1075873485)  rafa: @OzaCR G'nite! Tx por la ayudadisha
(1075861443)  MarcialC: @OzaCR Jajaja me imagino!! Hora del Relax!!
XD

Am I doing something wrong?



Re: Date Format: ex: about 2 hours ago

2008-12-24 Thread Chad Etzel
Here's the code I have been using for such a task (written in javascript).
Consider it a Christmas present :)

var getdatediff = function (now_ms, gmt)
{
  var dt_ms = Date.parse(gmt);

  var delta = now_ms - dt_ms;
  delta = Math.floor(delta / 1000);  // turn into seconds

  if (delta  86400) {
return '' + Math.floor(delta/86400) + ' days ago';
  } else if (delta  3600) {
return '' + Math.floor(delta/3600) + ' hours ' + Math.floor(delta/60) +
' minutes ago';
  } else if (delta  60) {
return '' + Math.floor(delta/60) + ' minutes ' + (delta % 60) + '
seconds ago';
  } else { // seconds
return '' + (delta % 60) + ' seconds ago';
  }

}


var main_or_whatever = function()
{

  //it is assumed tweet_arr is an array with tweets returned from a .json
API call or something...

  var tstamp = new Date(tweet_arr.results[i].created_at).toLocaleString();
  var now = new Date();
  var now_ms = now.getTime();

  var datediff = getdatediff(now_ms, tstamp);

  //print datediff in some fashion
  document.write(datediff);

}


-Chad

On Wed, Dec 24, 2008 at 6:08 AM, Matthew matthewrudyjac...@gmail.comwrote:


  All of the clients
 and the web post friendly things like about 2 hours ago. Can anyone
 provide a standard routine for converting the pure date element into
 these english strings?

 take a look at the way Rails does it as well,

 http://github.com/rails/rails/tree/master/actionpack/lib/action_view/helpers/date_helper.rb

 It's quite a common thing,
 so perhaps you should look at the source for Struts,
 or some similar java framework,
 see if you can steal the code directly from there.



Why isn't this code snippet working

2008-12-24 Thread hubs

I'm a total n00b. Could somebody tell me why this code doesn't work?

?php

$uname = 'hubs';
$pwd = 'bungle';
$twitter_url = 'http://twitter.com/statuses/followers/
hubs.xml';
$curl_handle = curl_init();
curl_setopt($curl_handle,CURLOPT_URL,$twitter_url);
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_USERPWD,$uname:
$pwd);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
$file = http://twitter.com/statuses/followers/hubs.xml;;
$xml = simplexml_load_file($file) or die (Sorry Twitter is having
another freakout. Were unable to load the necessary
files!);
foreach ($xml-xpath('//name') as $name) {
echo $name/n;
}
?


Re: Date Format: ex: about 2 hours ago

2008-12-24 Thread Cameron Kaiser

 Here's the code I have been using for such a task (written in javascript).
 Consider it a Christmas present :)

Very elegant. :)

-- 
 personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
-- A kindness done today is the surest way to a brighter tomorrow. -- Anonymous


Re: Why isn't this code snippet working

2008-12-24 Thread Cameron Kaiser

 I'm a total n00b. Could somebody tell me why this code doesn't work?

Can you be more specific about the exact failure? A trace from a proxy
such as Charles would also be helpful.

-- 
 personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
-- The only thing to fear is fearlessness -- R. E. M. -


Re: Why isn't this code snippet working

2008-12-24 Thread Alex Payne

You also want to obscure any passwords you paste as part of code samples.

On Wed, Dec 24, 2008 at 09:50, Cameron Kaiser spec...@floodgap.com wrote:

 I'm a total n00b. Could somebody tell me why this code doesn't work?

 Can you be more specific about the exact failure? A trace from a proxy
 such as Charles would also be helpful.

 --
  personal: http://www.cameronkaiser.com/ 
 --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
 -- The only thing to fear is fearlessness -- R. E. M. 
 -




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


Re: Expect Header Issue for .NET developers

2008-12-24 Thread Tom Morris

On Dec 24, 4:31 am, JakeS jakesteven...@gmail.com wrote:
 Looks like twitter is updating something and their servers are
 returning error 417 for a lot of requests.  I looked into it and found
 that .NET automatically includes an Expect header containing 100-
 continue on every request unless you specifically tell it not to.

 So for any .NET devs having trouble, you can set
 System.Net.ServicePointManager.Expect100Continue = false before making
 your request to get past this issue.

A lot of libraries follow this behaviour. A Twitter app I wrote in PHP
a while back has been logging 417s most of today. I logged in and
added:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

Other libcurl-based libraries may be affected. There are plenty of
reports about 417 and Expect on the cURL website - http://curl.haxx.se/
- and on the websites of particular language bindings.

--
Tom Morris (@tommorris)
http://tommorris.org


Re: Why isn't this code snippet working

2008-12-24 Thread Chad Etzel
I'm guessing you probably need to make it a POST request:

curl_setopt($ch, CURLOPT_POST, 1);

and yes, you should probably change your password if it wasn't already
changed when you posted :D

For reference, here are all of the curlopts I set when making requests:

curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $username:$pass);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);

-Chad

On Wed, Dec 24, 2008 at 1:54 PM, Alex Payne a...@twitter.com wrote:


 You also want to obscure any passwords you paste as part of code samples.

 On Wed, Dec 24, 2008 at 09:50, Cameron Kaiser spec...@floodgap.com
 wrote:
 
  I'm a total n00b. Could somebody tell me why this code doesn't work?
 
  Can you be more specific about the exact failure? A trace from a proxy
  such as Charles would also be helpful.
 
  --
   personal:
 http://www.cameronkaiser.com/ --
   Cameron Kaiser * Floodgap Systems * www.floodgap.com *
 ckai...@floodgap.com
  -- The only thing to fear is fearlessness -- R. E. M.
 -
 



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



Re: simple tweet this implementation

2008-12-24 Thread Alex Payne

I've got a fix for it, should go live Monday.

On Tue, Dec 23, 2008 at 21:40, scottjgo scott...@gmail.com wrote:

 Seems like it's still not working. Any update?

 To reproduce try: http://i2ft.com/znd and click the little twitter t
 in the frame. When it posts to the site, it still shows from web

 On Dec 13, 5:42 pm, Alex Payne a...@twitter.com wrote:
 Nope, we'll investigate it this coming week.  Hang tight!



 On Sat, Dec 13, 2008 at 12:29, scottjgo scott...@gmail.com wrote:

  Alex-

  I posted a follow-up on the bug for this feature -- would it be better
  for me to open a new bug?

  On Dec 13, 3:12 pm, Alex Payne a...@twitter.com wrote:
  Indeed, anybody can randomly fill in any source.  The incentive for
  faking requests from a particular application is so low that we don't
  put any protections in place.

  On Sat, Dec 13, 2008 at 09:32, Abraham Williams 4bra...@gmail.com wrote:
   Is it maybe tied into the referrer so it only works coming from the 
   website
   that is supposed to have the source? I find it unlikely that anybody can
   randomly fill in any source.

   On Sat, Dec 13, 2008 at 09:58, Dharmesh dharme...@gmail.com wrote:

   I have not been able to get this to work yet (i.e. passing a valid
   source= parameter still shows updates as being from the web).

   Example:http://twitter.com/home?status=Testingsource=TwitterGrader

   Thanks.

   -Dharmesh

   On Dec 12, 12:32 pm, scottjgo scott...@gmail.com wrote:
Has anyone gotten it to work? Am I doing something wrong?

On Dec 12, 12:20 pm, Alex Payne a...@twitter.com wrote:

 The feature has been deployed...

 On Thu, Dec 11, 2008 at 18:16, scottjgo scott...@gmail.com wrote:

  Hi.

  I guess this feature was added a week ago. Thanks!

  I'm having a bit of trouble with it though. I tried the url
 http://twitter.com/home?status=testsource=isitfunnytodaycom(my
  source paramter was approved over 48 hours ago) and my post is 
  still
  'from web'. I also tried using the source parameter twitterific,
  which
  also showed up as 'from web'. Is feature not deployed yet?

  On Nov 21, 5:01 pm, scottjgo scott...@gmail.com wrote:
 http://code.google.com/p/twitter-api/issues/detail?id=163

  On Nov 21, 2:51 pm, Alex Payne a...@twitter.com wrote:

   We recently had another request to allow messages posted from 
   the
   web
   to define their own source parameters.  We'll consider it.
Please
   file an issue
   athttp://code.google.com/p/twitter-api/issues/entry.

   On Fri, Nov 21, 2008 at 01:36, scottjgo scott...@gmail.com
   wrote:

Bummer.

I don't suppose you'd be willing to add a simple appid= or
something
to the url that lets you modify the posted from link (given
that the
link was already approved for your app id)?

On Nov 20, 5:03 pm, Alex Payne a...@twitter.com wrote:
Yes, you'll need to make a proper API request to have your
update
attributed.

--
Alex Payne

On Nov 20, 2008, at 10:05, scottjgo scott...@gmail.com
wrote:

 Hi.

 I want to add a tweet this link to my website. The 
 idea is
 that you
 would click the button, and it would prepopulate the 
 message
 field on
 twitter with a link. Ideally, you would authenticate 
 through
 twitter.com so I can avoid handling passwords.

 I understand you can use a link
 like:http://twitter.com/home?status=Putyourmessagehere
 but is it possible to replace the from web with a link 
 to
 my
 website? Without that, it sort of eliminates the cool 
 viral
 advertising. Is the only alternative to use the real api
 (and handle
 passwords)?

 Thanks.
 -sjg

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

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

   --
   | Abraham Williams | Web Developer |http://abrah.am
   | Brazen Careerist | Pro Hacker |http://www.brazencareerist.com
   | PoseurTech LLC | Mashup Ambassador |http://poseurte.ch
   | Web608 | Community Evangelist |http://web608.org
   | This email is: [] blogable [x] ask first [] private

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

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




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


Re: Expect Header Issue for .NET developers

2008-12-24 Thread dean.j.robinson

Started getting reports from users yesterday that they couldn't login
to hahlo.com.

Turns out that the check I run against verify credentials was also
returning code 417 instead of the usual/expected 200, so even though
the check was working to hahlo is looked like it was failing, changed
my check to include code 417 and now its working again.

Strangely though, a local dev copy of Hahlo 4, which also checks
verify credentials and also only expects a 200 response, is still
working fine..,




On Dec 25, 6:57 am, Tom Morris t...@tommorris.org wrote:
 On Dec 24, 4:31 am, JakeS jakesteven...@gmail.com wrote:

  Looks like twitter is updating something and their servers are
  returning error 417 for a lot of requests.  I looked into it and found
  that .NET automatically includes an Expect header containing 100-
  continue on every request unless you specifically tell it not to.

  So for any .NET devs having trouble, you can set
  System.Net.ServicePointManager.Expect100Continue = false before making
  your request to get past this issue.

 A lot of libraries follow this behaviour. A Twitter app I wrote in PHP
 a while back has been logging 417s most of today. I logged in and
 added:
 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

 Other libcurl-based libraries may be affected. There are plenty of
 reports about 417 and Expect on the cURL website -http://curl.haxx.se/
 - and on the websites of particular language bindings.

 --
 Tom Morris (@tommorris)
 http://tommorris.org


Re: Expect Header Issue for .NET developers

2008-12-24 Thread Barry Carlyon


I'm currently getting 417 as well on my php from script using curl

Sent from my iPhone

On 24 Dec 2008, at 23:50, dean.j.robinson  
dean.j.robin...@gmail.com wrote:




Started getting reports from users yesterday that they couldn't login
to hahlo.com.

Turns out that the check I run against verify credentials was also
returning code 417 instead of the usual/expected 200, so even though
the check was working to hahlo is looked like it was failing, changed
my check to include code 417 and now its working again.

Strangely though, a local dev copy of Hahlo 4, which also checks
verify credentials and also only expects a 200 response, is still
working fine..,




On Dec 25, 6:57 am, Tom Morris t...@tommorris.org wrote:

On Dec 24, 4:31 am, JakeS jakesteven...@gmail.com wrote:


Looks like twitter is updating something and their servers are
returning error 417 for a lot of requests.  I looked into it and  
found

that .NET automatically includes an Expect header containing 100-
continue on every request unless you specifically tell it not to.



So for any .NET devs having trouble, you can set
System.Net.ServicePointManager.Expect100Continue = false before  
making

your request to get past this issue.


A lot of libraries follow this behaviour. A Twitter app I wrote in  
PHP

a while back has been logging 417s most of today. I logged in and
added:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

Other libcurl-based libraries may be affected. There are plenty of
reports about 417 and Expect on the cURL website -http:// 
curl.haxx.se/

- and on the websites of particular language bindings.

--
Tom Morris (@tommorris)
http://tommorris.org


Re: Why isn't this code snippet working

2008-12-24 Thread hubs

This is the error code I'm getting:

Warning: simplexml_load_file(http://twitter.com/statuses/followers/
hubs.xml) [function.simplexml-load-file]: failed to open stream: HTTP
request failed! HTTP/1.1 401 Unauthorized in /home/.jerrie/hubs/
artifacting.com/blog/wp-content/plugins/runPHP/runPHP.php(383) : eval
()'d code on line 16

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O
warning : failed to load external entity http://twitter.com/statuses/
followers/hubs.xml in /home/.jerrie/hubs/artifacting.com/blog/wp-
content/plugins/runPHP/runPHP.php(383) : eval()'d code on line 16


I'm running the code within a wordpress enty.
Thanks.

On Dec 24, 10:50 am, Cameron Kaiser spec...@floodgap.com wrote:
  I'm a total n00b. Could somebody tell me why this code doesn't work?

 Can you be more specific about the exact failure? A trace from a proxy
 such as Charles would also be helpful.

 --
  personal:http://www.cameronkaiser.com/--
   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
 -- The only thing to fear is fearlessness -- R. E. M. 
 -


Re: Expect Header Issue for .NET developers

2008-12-24 Thread PockeTwitDev

After investigating further it appears this only occurs for .NET
applications which post using form data instead of using URL
parameters.  Here's a sample:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = new NetworkCredential(AccountInfo.UserName,
AccountInfo.Password);
request.PreAuthenticate = true;
request.ContentType = application/x-www-form-urlencoded;
request.Method = POST;
request.Headers.Add(Authorization, Basic  + Convert.ToBase64String
(Encoding.ASCII.GetBytes(AccountInfo.UserName + : +
AccountInfo.Password)));
byte[] bytes = Encoding.UTF8.GetBytes(data); //Data is what's being
posted
request.ContentLength = bytes.Length;
System.Net.ServicePointManager.Expect100Continue = false;   //NEED
THIS NOW TO FIX ERROR 417
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Flush();
}
 using (HttpWebResponse response = (HttpWebResponse)request.GetResponse
())
{
using (StreamReader reader = new StreamReader
(response.GetResponseStream()))
{
return reader.ReadToEnd();
}
}

I don't doubt that it's a bug in the development platforms, but even
so it's a pretty common one.  It doesn't appear to happen to those
apps which just URLEncode the data and include it in the URL, but I
don't think that's exactly proper specification either :)


On Dec 24, 1:57 pm, Tom Morris t...@tommorris.org wrote:
 On Dec 24, 4:31 am, JakeS jakesteven...@gmail.com wrote:

  Looks like twitter is updating something and their servers are
  returning error 417 for a lot of requests.  I looked into it and found
  that .NET automatically includes an Expect header containing 100-
  continue on every request unless you specifically tell it not to.

  So for any .NET devs having trouble, you can set
  System.Net.ServicePointManager.Expect100Continue = false before making
  your request to get past this issue.

 A lot of libraries follow this behaviour. A Twitter app I wrote in PHP
 a while back has been logging 417s most of today. I logged in and
 added:
 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

 Other libcurl-based libraries may be affected. There are plenty of
 reports about 417 and Expect on the cURL website -http://curl.haxx.se/
 - and on the websites of particular language bindings.

 --
 Tom Morris (@tommorris)
 http://tommorris.org


Twitter blocking my application from sending tweets or receiving tweets.

2008-12-24 Thread dattas

Twitter blocking my application from sending tweets or receiving
tweets, from what I've heard it can take month to get tickets with
Twitter resolved. I know it is not my code that is doing it, because
it worked in the past and if I take out the source=atweeter then it
starts working again. I wouldn't mind taking that out, however without
warning and with it working for months before without problems I don't
see how its my application, if someone from twitter can please let me
know whats going on and why you've blocked my application I would be
more than happy to fix any problem!


Re: Why isn't this code snippet working

2008-12-24 Thread hubs

hubs wrote:
 I'm a total n00b. Could somebody tell me why this code doesn't work?
 
 ?php
 
 $uname = 'hubs';
 $pwd = 'bungle';
 $twitter_url = 'http://twitter.com/statuses/followers/
 hubs.xml';
 $curl_handle = curl_init();
 curl_setopt($curl_handle,CURLOPT_URL,$twitter_url);
 curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
 curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
 curl_setopt($curl_handle,CURLOPT_USERPWD,$uname:
 $pwd);
 $buffer = curl_exec($curl_handle);
 curl_close($curl_handle);
 $file = http://twitter.com/statuses/followers/hubs.xml;;
 $xml = simplexml_load_file($file) or die (Sorry Twitter is having

You should load the XML from $buffer, not $file.
$xml = simplexml_load_string($buffer); ought to work.

-Matt


Replace from web with source for all posts

2008-12-24 Thread bnonews

Hi,

We recently created a script for our staff (at @BreakingNewsOn) that
posts important updates from news wires when there is no one to
update. The source code was already approved but I was wondering if
you can apply the source code to all posts? Also the posts from web,
mobile etc.

I hope this is possible.

Thanks,
Michael


POST, Expect header, and Apache HttpClient (Java)

2008-12-24 Thread Tom Nichols

There is a similar issue when using Apache HttpClient (a common HTTP
framework for Java).  It appears that POST requests will automatically
add an Expect: 100-Continue header.  And I suspect this is failing
because HttpClient does not attempt to send auth credentials until
first challenged by a 401 response.  So every POST by a client that
doesn't first receive a 401 response will not send the credentials,
and hence get a 417 response when the server can't let the client
Continue.

Anyway, short answer is, there is a similar solution for HttpClient,
by setting this param on the request object:

request.getParams().setBooleanParameter( http.protocol.expect-
continue, false );


related to threads:
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/a30dc0bb2fedeecd
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/7c67ff1a2407dee7

Hope this helps someone.


Re: Twitter blocking my application from sending tweets or receiving tweets.

2008-12-24 Thread Alex Payne

What error message and HTTP response code are you getting when you try
to call a Twitter API method?  Chances are good your application is
affected by the .NET Expect header bug that's been documented in
another thread on this group.

On Wed, Dec 24, 2008 at 10:04, dattas dattasm...@gmail.com wrote:

 Twitter blocking my application from sending tweets or receiving
 tweets, from what I've heard it can take month to get tickets with
 Twitter resolved. I know it is not my code that is doing it, because
 it worked in the past and if I take out the source=atweeter then it
 starts working again. I wouldn't mind taking that out, however without
 warning and with it working for months before without problems I don't
 see how its my application, if someone from twitter can please let me
 know whats going on and why you've blocked my application I would be
 more than happy to fix any problem!




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