[twitter-dev] Re: API HTTP Post statuses/update.xml

2010-07-29 Thread natefanaro
From personal experience the limit is around 150 per hour. That number
has been raised/lowered in the past and yes the error message is
misleading. It is possible that the 150 per hour is just a hard limit
and 1000 per day is a policy limit. Either way if you can technically
post 150 an hour that's as many as you're going to be able to do.
Unless you present a very very good case to Twitter I don't believe
this limit can be raised.

I know the link Matt gave has some solid numbers but I wouldn't expect
any more detail than that. It's been mentioned in this group before
that exact numbers can't be given about some limits. They can change
at any time and spammers could use that info to fly under the spam
team's radar.

On Jul 29, 3:50 pm, Eric Mortensen emort...@gmail.com wrote:
 Why not? If Twitter states I can send 150 an hour or 1000 a day I should be
 able to.  Not my rules its twitters. So I guess it needs to be written
 somewhere that 42 per hour is the limit.  I am just trying to understand why
 it appears that I am hitting a limit when i am only doing what twitter
 apparently allows.  The limit I see is possibly the number of messages sent
 at one time and twitter can't handle it and throws the error I have been
 receiving.  So if that exists than I understand.  I just need to know where
 it is stated.  The error message appears to wrong as well since I can still
 send tweets and it has been a couple hours later.  Then I can tell the
 program manager that this is why we can't send this many messages because of
 this limit.  Maybe what will help is a link stating that there are
 protections that prevent a certain number of updates/tweets happening at
 once.

 Thanks

 On Thu, Jul 29, 2010 at 3:22 PM, Matt Harris thematthar...@twitter.comwrote:

  Why are you sending so many Tweets? It sounds like you are being restricted
  because you are sending too many per hour. The limit of updates per day
  exists but there are protections to prevent all those updates happening at
  once. I'm not familiar with the code that handles the measure windows or
  what the limits are but consider that 1000 tweets per day is approx 42 per
  hour.

  Matt

  On Thu, Jul 29, 2010 at 8:59 AM, Eric Mortensen emort...@gmail.comwrote:

  For instance, set up the my database to create 200 tweets to post to a
  account. It ran at 11:49 AM EST.  I noticed that 127 tweets were posted and
  the remaining got kicked with the error response. Not sure if there is a
  limit of 127 I thought it was 150 limit per hour.  This also does not hit
  the 1000 daily limit since it was only 200 tweets.  I will try this again 
  in
  about 1 hour.  I should be able to start tweeting again.  Let me know what
  you think?

  On Wed, Jul 28, 2010 at 12:19 PM, Eric Mortensen emort...@gmail.comwrote:

  But, It appears did not hit a 1000 update limit since after an hour and
  can start updates again.  That why it appears to be an hourly limit.  Not 
  to
  mention when this started I did not even have a 1000 tweets total on the
  account.  That is why it can't be the 1000 a day limit. There is should be
  another reason for this.

  On Tue, Jul 27, 2010 at 6:56 PM, Matt Harris 
  thematthar...@twitter.comwrote:

  Hey Eric,

  That error is the Twitter Limits kicking in saying there are too many
  status updates being posted by the account. This isn't an API rate limit 
  but
  a natural limit which applies to all of Twitter. A user may not Twitter 
  more
  than 1000 updates a day (this includes retweets).

  More information on these limits are explained on the page I linked to
  before:  http://support.twitter.com/forums/10711/entries/15364

  Hope that clarifies the what is happening.
  Matt

  On Tue, Jul 27, 2010 at 12:27 PM, Eric Mortensen 
  emort...@gmail.comwrote:

  Here is a response:
  ?xml version=1.0 encoding=UTF-8?
  hash
    errorUser is over daily status update limit./error
    request/1/statuses/update.xml/request
  /hash

  On Thu, Jul 15, 2010 at 5:41 PM, Matt Harris 
  thematthar...@twitter.com wrote:

  Hey Eric,

  Sorry that help article didn't answer your question. Can you provide
  the actual HTTP request being made and the HTTP response you get back? 
  We're
  interested in the response body content in particular.

  Also, remember we disable basic authentication on August 16th so you
  want to switch to that method of authentication now.

  Matt

  On Thu, Jul 15, 2010 at 12:46 PM, Eric Mortensen 
  emort...@gmail.comwrote:

  Unfortunately not.  Do you have anything else that might explain it?

  On Thu, Jul 15, 2010 at 1:48 PM, Matt Harris 
  thematthar...@twitter.com wrote:

  Hi Eric,

  In addition to the API Rate Limits there are general usage limits
  which apply to all of Twitter, including the website. These limits 
  restrict
  various actions including the number of updates that can be posted 
  per day.

  You can read more about Twitter Limits on our help website:
 

[twitter-dev] Re: Sample twitter application

2010-03-26 Thread natefanaro
I'm going to guess that you don't have shell access on that machine.
Make sure your web host can contact api.twitter.com. One way to do
that is with this command curl -v 
http://api.twitter.com/1/statuses/public_timeline.rss

If there's an error or no output then your host has to figure out why
they can't connect to api.twitter.com from that machine.

On Mar 25, 11:54 pm, Dushyant dushyantaror...@gmail.com wrote:
 I did what you said now I get the following output
 Curl error: couldn't connect to host
 Error: 0

 On Mar 25, 7:39 pm, natefanaro natefan...@gmail.com wrote:

  At first glance there are two things you want to change. The $url
  should be changed tohttp://api.twitter.com/1/statuses/update.format

  Not sure why you're trying to run that through a proxy on port 80 but
  that should be why you're receiving the 404. Remove this line
  curl_setopt($ch, CURLOPT_PROXY,localhost:80);

  On Mar 25, 7:37 am, Dushyant dushyantaror...@gmail.com wrote:

   I have installed WAMP and running PHP scripts on localhost. I have
   enabled cURL. Here is my code.

   ?php
   function updateTwitter($status)
   {
    // Twitter login information
    $username = 'x';
    $password = 'x';
    // The url of the update function
    $url = 'http://twitter.com/statuses/update.xml';
    // Arguments we are posting to Twitter
    $postargs = 'status='.urlencode($status);
    // Will store the response we get from Twitter
    $responseInfo=array();
    // Initialize CURL
    $ch = curl_init($url);
    // Tell CURL we are doing a POST
    curl_setopt($ch, CURLOPT_PROXY,localhost:80);
    curl_setopt ($ch, CURLOPT_POST, true);
    // Give CURL the arguments in the POST
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);
    // Set the username and password in the CURL call
    curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
    // Set some cur flags (not too important)
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 0);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    // execute the CURL call
    $response = curl_exec($ch);
    if($response === false)
   {
       echo 'Curl error: ' . curl_error($ch);}

   else
   {
       echo 'Operation completed without any errorsbr/';

   }

    // Get information about the response
    $responseInfo=curl_getinfo($ch);
    // Close the CURL connection curl_close($ch);
    // Make sure we received a response from Twitter
    if(intval($responseInfo['http_code'])==200){
     // Display the response from Twitter
     echo $response;
    }else{
     // Something went wrong
     echo Error:  . $responseInfo['http_code'];
    }
   curl_close($ch);
    }

   updateTwitter(Test tweet);

   ?

   Here's my output

   Operation completed without any errors
   Error: 404

   Please help.

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.


[twitter-dev] Re: Sample twitter application

2010-03-25 Thread natefanaro
At first glance there are two things you want to change. The $url
should be changed to http://api.twitter.com/1/statuses/update.format

Not sure why you're trying to run that through a proxy on port 80 but
that should be why you're receiving the 404. Remove this line
curl_setopt($ch, CURLOPT_PROXY,localhost:80);

On Mar 25, 7:37 am, Dushyant dushyantaror...@gmail.com wrote:
 I have installed WAMP and running PHP scripts on localhost. I have
 enabled cURL. Here is my code.

 ?php
 function updateTwitter($status)
 {
  // Twitter login information
  $username = 'x';
  $password = 'x';
  // The url of the update function
  $url = 'http://twitter.com/statuses/update.xml';
  // Arguments we are posting to Twitter
  $postargs = 'status='.urlencode($status);
  // Will store the response we get from Twitter
  $responseInfo=array();
  // Initialize CURL
  $ch = curl_init($url);
  // Tell CURL we are doing a POST
  curl_setopt($ch, CURLOPT_PROXY,localhost:80);
  curl_setopt ($ch, CURLOPT_POST, true);
  // Give CURL the arguments in the POST
  curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);
  // Set the username and password in the CURL call
  curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
  // Set some cur flags (not too important)
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch, CURLOPT_NOBODY, 0);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  // execute the CURL call
  $response = curl_exec($ch);
  if($response === false)
 {
     echo 'Curl error: ' . curl_error($ch);}

 else
 {
     echo 'Operation completed without any errorsbr/';

 }

  // Get information about the response
  $responseInfo=curl_getinfo($ch);
  // Close the CURL connection curl_close($ch);
  // Make sure we received a response from Twitter
  if(intval($responseInfo['http_code'])==200){
   // Display the response from Twitter
   echo $response;
  }else{
   // Something went wrong
   echo Error:  . $responseInfo['http_code'];
  }
 curl_close($ch);
  }

 updateTwitter(Test tweet);

 ?

 Here's my output

 Operation completed without any errors
 Error: 404

 Please help.

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.


[twitter-dev] Re: getting authenticated user's rate-limit-using rest API.

2010-03-23 Thread natefanaro
There is no way that Twitter's api is going to let you swap between
two users (ie: here are two usernames that can auth, swap to the other
when one runs out of hits)

You will have to check the authenticating user's rate limit before
each request. When that account hits 0, authenticate with the second
user, check it's rate limit, if it's greater than 0 continue with the
request.

If you code your app this way your request won't be interrupted. But
instead of going through hoops like this could you explain what you're
doing that requires over 20,000 requests per hour? I can't speak for
Twitter but I would guess that using multiple accounts to get around
rate limits is frowned upon. There may be an easier way to achieve
what you're doing (streaming/higher access levels/etc)

On Mar 23, 7:02 am, Rushikesh Bhanage rishibhan...@gmail.com wrote:
 Hi there,
       Yes I got your point Sir and that's the problem automatic switching of
 user does not take place. Yes authentication is essential, but can I do that
 using rate_limit_status method(passing user name and password to method) for
 these two users or OAuth is the option, but it's not possible in this
 case(have already implemented OAuth in app), because this is going to be
 automatically. Above two user names will be white listed A/C's(that I am
 going to do as this problem will get solved on current requests).  I read
 Twitter api documentation, in that I got clue to pass unm and pwd  using
 cURL ( have used it) like this-

 curl -u 
 user:passwordhttp://api.twitter.com/1/account/rate_limit_status.xmlhttp://twitter.com/account/rate_limit_status.xml
   is this possible?

 Thank you in advance sir.

 -- Rishi.

 On Mon, Mar 22, 2010 at 10:32 PM, Mark McBride mmcbr...@twitter.com wrote:
  Authenticate as the second user.

    ---Mark

 http://twitter.com/mccv

  On Sun, Mar 21, 2010 at 11:55 PM, Rushikesh Bhanage 
  rishibhan...@gmail.com wrote:

  Hi,
      (Note: In my app, single white listed useraccount's requests are not
  sufficient to complete particular task, so i need to switch from one 
  account
  to another without breaking operation, if previous A/C's hits got over. )
     In my case both the users are authenticated. Now problem is that how to
  switch from one user to another, when  next user comes, he should come up
  with it's hits for the operations, when previous user's hits got over. In
  such situation how can i use rate_limit_status method.

  Thank you in advance,

  rishibhanage

  On Mon, Mar 22, 2010 at 1:19 AM, Chris Thomson chri...@chris24.cawrote:

  The rate_limit_status method does not take a username as a parameter. All
  account methods act on the authenticating user's account (or in the case 
  of
  an unauthenticated call, the requesting IP address). In order to get each
  other's rate limit information, you'll need to have both the user's
  authenticated as themselves.

   --
  Chris Thomson

  On Mar 21, 2010, at 8:01 AM, Rushikesh Bhanage wrote:

  Hi, there,
       I am using rest api method in my app, in that, I have two users(i.e
  white-listed user accounts.) and need to get each user's account 
  rate-limit
  request balance, I am using following URL to get request balance.

  'http://twitter.com/account/rate_limit_status/'.$unm.'.xmlhttp://twitter.com/account/rate_limit_status/%27.$unm.%27.xml'.
   Here $unm is user name passed through ratelimit() function .

   Below is the code logic: (using cURL functions )

  [     function Checklimit()
          {
              for($i=0; $i2; $i++)
              {
                  $usrlimit =
  $this-ratelimit($this-u[$i]);                      // ratelimit($unm)
  function will give array containing remaining hits.
                  foreach($usrlimit as $key=$val)
         // $this-u[]  is the array used for fetching users with $i.
                  {
                      if($key == 'remaining-hits')
                      {
                          if($val != 0)

  {                                                                    // 
  here
  will return array element which is having hits.
                             return
  $i;                                                     // here it doesn't
  come inside when value of ratelimit of first user comes to an end
                           }

                      }
                  }
            // Actually here it goes to second user but does not get it's
  hits from api using ratelimit function. gets same 0 as like first user. It
  will return -1 when no user is having hits.
              }
              return -1;
          }

  ]

  Can I have some clue, please.

  Thank You in advance.

  with regards,
  rishibhanage.

   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.

   To unsubscribe from this group, send email to twitter-development-talk+
  unsubscribegooglegroups.com or reply to this 

[twitter-dev] Re: PROBLEM WITH STATUSES ID RETURNED FROM SEARCH

2010-03-17 Thread natefanaro
Twitter went past id 2147483647 a while ago. Whatever you're using to
parse the response has to support an id larger than a 32-bit signed
integer or treat id as a string.

On Mar 17, 1:35 am, brunobar79 brunoba...@gmail.com wrote:
 I found this problem while i was trying to add and delete some
 favorites to my acocunt and the response was always NOT FOUND

 Below is a var dump of  the result when searching google
 If you have a look you will see on each status the propery [id]=
 int(2147483647)
 It's really strange because it's the only value that is repeat in all
 the results

 Anyone experienced the same problem?
 Thanks in advance...

 Bruno Barbieri

 object(stdClass)#6 (10) { [profile_image_url]=  string(66) http://
 a1.twimg.com/profile_images/668359342/
 androidnew_normal.jpg [created_at]=  string(31) Wed, 17 Mar 2010
 05:23:25 + [from_user]=  string(12)
 News4Android [to_user_id]=  NULL [text]=  string(139) From
 News/Blogs: Motorola BackFlip vs. Motorola Cliq vs. Google Nexus One
 vs ...: The Google Phone, AKA Ne...http://bit.ly/d5j7NG
 #android [id]=  int(2147483647) [from_user_id]=  int(72340308)
 [geo]=  NULL [iso_language_code]=  string(2) en [source]=
 string(95) a href=http://twitterfeed.com;
 rel=nofollowtwitterfeed/a }

 object(stdClass)#7 (11) { [profile_image_url]=  string(71) http://
 a1.twimg.com/profile_images/560679578/
 MikeLovatosmall_normal.jpg [created_at]=  string(31) Wed, 17 Mar
 2010 05:23:23 + [from_user]=  string(10)
 mikelovato [to_user_id]=  int(39256) [text]=  string(100)
 @mikekell is it partially closed because of the construction? google
 maps traffic shows it horrible [id]=  int(2147483647)
 [from_user_id]=  int(22971) [to_user]=  string(8)
 mikekell [geo]=  NULL [iso_language_code]=  string(2)
 en [source]=  string(95) a href=http://www.tweetdeck.com;
 rel=nofollowTweetDeck/a }

 object(stdClass)#8 (10) { [profile_image_url]=  string(66) http://
 a1.twimg.com/profile_images/668359342/
 androidnew_normal.jpg [created_at]=  string(31) Wed, 17 Mar 2010
 05:23:23 + [from_user]=  string(12)
 News4Android [to_user_id]=  NULL [text]=  string(139) From
 News/Blogs: HTC Google Nexus One: Dear everyone calling the Nexus One
 a flop ...: ne-vs-Google-Nexus-...http://bit.ly/d8XOxt
 #android [id]=  int(2147483647) [from_user_id]=  int(72340308)
 [geo]=  NULL [iso_language_code]=  string(2) en [source]=
 string(95) a href=http://twitterfeed.com;
 rel=nofollowtwitterfeed/a }


[twitter-dev] Re: Perl script for retrieving twits

2009-12-01 Thread natefanaro
You just built an object. If you want to read tweets you have to use a
function that retrieves them.

For example, if you want to search for tweets
my $r = $nt-search(hello world);
print Dumper $r;

It may help if you read the documentation for that module
http://search.cpan.org/dist/Net-Twitter/lib/Net/Twitter.pod

On Dec 1, 9:20 am, Oreste ore...@parlatano.org wrote:
 I'm usingNet::Twittermodule which is working nicely. I'm getting
 back a lot of variables, I need to grab just those variables giving me
 the message and date. Could you help me to find them out?

 This is the script I'm using:

 useNet::Twitter;
 use Data::Dumper;
 my $nt =Net::Twitter-new(
 traits   = [qw/API::REST/],
 username = 'user',
 password = 'pass'
 );
 print Dumper $nt;

 Here are the results:

 $VAR1 = bless( {
                  'ua' = bless( {
                                   'max_redirect' = 7,
                                   'protocols_forbidden' = undef,
                                   'no_proxy' = [],
                                   'protocols_allowed' = undef,
                                   'use_eval' = 1,
                                   'requests_redirectable' = [
                                                                'GET',
                                                                'HEAD'
                                                              ],
                                   'from' = undef,
                                   'timeout' = 180,
                                   'agent' = 'Net::Twitter/3.07001
 (Perl)',
                                   'def_headers' = bless( {
                                                             'x-twitter-
 client' = 'PerlNet::Twitter',
                                                             'x-twitter-
 client-version' = '3.07001',
                                                             'x-twitter-
 client-url' = 'http://search.cpan.org/dist/Net-Twitter/'
                                                           },
 'HTTP::Headers' ),
                                   'parse_head' = 1,
                                   'proxy' = {},
                                   'basic_authentication' = {

 'twitter.com:80' = {

 'Twitter API' = [

 'user',

 'pass'
                                                                               
                        ]
                                                                               
     }
                                                             },
                                   'max_size' = undef
                                 }, 'LWP::UserAgent' ),
                  'source' = 'twitterpm',
                  'decode_html_entities' = '0',
                  'netrc' = '0',
                  'clientname' = 'PerlNet::Twitter',
                  'useragent' = 'Net::Twitter/3.07001 (Perl)',
                  'apihost' = 'twitter.com:80',
                  'apirealm' = 'Twitter API',
                  'clientver' = '3.07001',
                  'password' = 'pass',
                  '_json_handler' = bless( [
                                              bless( do{\(my $o = '')},
 'JSON::XS' ),
                                              'encode',
                                              'decode',
                                              1
                                            ], 'JSON::Any' ),
                  'useragent_class' = 'LWP::UserAgent',
                  'clienturl' = 'http://search.cpan.org/dist/Net-Twitter/',
                  'ssl' = '0',
                  'useragent_args' = {},
                  'username' = 'user',
                  'apiurl' = 'http://twitter.com'
                }, 'Class::MOP::Class::__ANON__::SERIAL::2' );

[twitter-dev] Re: Updates not being indexed?

2009-11-10 Thread natefanaro

Looks like that account is no longer in the search index. You can test
that by searching for from:ProgressivePST 
http://search.twitter.com/search?q=from%3AProgressivePST

This probably happened because of the amount of automated tweets
containing links that you have.

On Nov 10, 10:41 am, neal rauhauser nrauhau...@gmail.com wrote:
    I have a userid that automatically places messages for campaigns and
 initiatives - political stuff, House  Senate, health care reform, etc.

 http://twitter.com/ProgressivePST

    Last night I rounded up links for all 435 House seats and began
 populating their hashtags.

 #MA08 is represented by Michael Capuanohttp://www.house.gov/capuano/
 #CA18 is represented by Dennis Cardozahttp://www.house.gov/cardoza/
 #MO03 is represented by John 
 Carnahanhttp://carnahan.house.gov/@repcarnahan

     The updates seem to flow based on inspection of the userid's link, but
 neither hashtags nor @ messages appear in public search. Am I doing
 something wrong? Is the userid tagged as spam? I'd really like to hear from
 someone at Twitter about this ...

 --
 mailto:n...@layer3arts.com //
 GoogleTalk: nrauhau...@gmail.com
 IM: nealrauhauser


[twitter-dev] Re: Updates not being indexed?

2009-11-10 Thread natefanaro

It's not really an issue with volume. You are way below the hourly
limit of the number of tweets allowed. Once you hit that limit you'll
know. The api will return an error stating you're over your allowed
status updates for the hour.

From what I can tell not being indexed by search only affects search.
If someone is following or if you mention someone you they will still
see your tweets. I can't speak for Twitter as to why they leave
accounts out of search. It could either be related to reducing how
much data the search service goes through or trying to lessen spammy
tweets. You might be able to email the team at a...@twitter.com to get
back in the search index.

If you are only using search to track your sent tweets you could store
tweet data in your own database.

On Nov 10, 11:11 am, neal rauhauser nrauhau...@gmail.com wrote:
   I've been kind of slinking along in development mode and I'm not terribly
 slick with Twitter. I'm now at a point where there is going to be a LOT of
 attention on this - how does one ask/register/apologize/grovel to be able to
 do a higher volume of messaging?

   I've been digging for tech support and right now the low resistance path
 seems to be scooting into Boston, knocking on the door at Spark Capital, and
 asking for Bijan Sabet. I hope there's an easier method :-)



 On Tue, Nov 10, 2009 at 9:57 AM, natefanaro natefan...@gmail.com wrote:

  Looks like that account is no longer in the search index. You can test
  that by searching for from:ProgressivePST
 http://search.twitter.com/search?q=from%3AProgressivePST

  This probably happened because of the amount of automated tweets
  containing links that you have.

  On Nov 10, 10:41 am, neal rauhauser nrauhau...@gmail.com wrote:
      I have a userid that automatically places messages for campaigns and
   initiatives - political stuff, House  Senate, health care reform, etc.

  http://twitter.com/ProgressivePST

      Last night I rounded up links for all 435 House seats and began
   populating their hashtags.

   #MA08 is represented by Michael Capuanohttp://www.house.gov/capuano/
   #CA18 is represented by Dennis Cardozahttp://www.house.gov/cardoza/
   #MO03 is represented by John Carnahanhttp://
  carnahan.house.gov/@repcarnahan

       The updates seem to flow based on inspection of the userid's link,
  but
   neither hashtags nor @ messages appear in public search. Am I doing
   something wrong? Is the userid tagged as spam? I'd really like to hear
  from
   someone at Twitter about this ...

   --
   mailto:n...@layer3arts.com //
   GoogleTalk: nrauhau...@gmail.com
   IM: nealrauhauser

 --
 mailto:n...@layer3arts.com //
 GoogleTalk: nrauhau...@gmail.com
 IM: nealrauhauser


[twitter-dev] Re: basic help needed on connect to TWITTER and send a tweet with PERL

2009-10-13 Thread natefanaro

Twitter has a list of libraries that should help
http://apiwiki.twitter.com/Libraries#Perl

Usually when I want to start working with an api in perl I check cpan
our first
http://search.cpan.org/search?query=twittermode=all

Most libraries in cpan will have some example code to get you going.

On Oct 13, 6:33 am, apfelmaennchen alexander.grefr...@gmail.com
wrote:
 I really find it difficult to understand documentation how to code a
 TWITTER-API in perl. But with a bit start-help, I think I'll be able
 to proceed.

 Can somebody help me with a sample PERL-code:

 From within a PERL script  ( which has two variables filled with
 strings. names of those VARS are $VAR1, $VAR2) I want to

 a) connect to twitter (lets assume username = test, password =
 water)
 b) send a tweet Hello world $VAR1 {space} $VAR2. This is my first
 test tweet automatically posted from a perl script.
 c) disconnect from twitter

 Maybe you also can give a command-reference, something like perl
 TWITTER API in a nutshell.

 Very many thanks for your help, Alex


[twitter-dev] Re: API REST problem

2009-08-25 Thread natefanaro

There are a few status updates on @cltag that are fairly similar. If
you're posting the same tweet multiple times twitter will only accept
the first tweet and ignore the rest. To test this add a timestamp at
the end of each tweet like this status=$mensaje.time() and try
again.

Instead of checking for an empty buffer you may want to use $info =
curl_getinfo($curl_handle) after curl_exec() and check out that $info
array. More specifically $info['http_code']. That will make debugging
this and other issues a little easier for you.

On Aug 25, 3:08 pm, onelix aoto...@gmail.com wrote:
 Hi, im using API REST for update data from a bot (@cltag), the script
 works fine, but, only sometimes update the timeline.

 When i run manually the php script it works perfectly one time, but it
 doesnt do it anymore in one  hour or two.
 It use the TwitterSearch.php library. this is a piece of my code.

 function twittear($mensaje){
         $username = 'cltag';
         $password = 'password';
         $url = 'http://twitter.com/statuses/update.xml';
         $curl_handle = curl_init();
         curl_setopt($curl_handle, CURLOPT_URL, $url);
         curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
         curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($curl_handle, CURLOPT_POST, 1);
         curl_setopt($curl_handle, CURLOPT_POSTFIELDS, status=$mensaje);
         curl_setopt($curl_handle, CURLOPT_USERPWD, $username:$password);
         $buffer = curl_exec($curl_handle);
         curl_close($curl_handle);
         if (empty($buffer)) {
                 echo 'Error: mensaje vacio';
         } else {
                 echo 'Ultimo Twitt a '.$username.':br '.$mensaje;
         }

 }

 and then i call from another php script this funcion (the $mensaje is
 a string with 5 hashtags from TwitterSearch.php).

 Thanx!, and sorry but english is not my first language.


[twitter-dev] Re: Permanent URL to profile images?

2009-08-18 Thread natefanaro

There is no officially supported way to get a static url for profile
images but if you're familiar with google app engine you may want to
check this out: http://code.google.com/p/spiurl/

On Aug 18, 1:34 pm, Adriano Nagel a...@safira.com wrote:
 Hi,

 Is there a permanent URL to user profile images? Currently when a user
 changes his avatar, my app displays a broken image.

 I'm trying to avoid looking for updates periodically, but I couldn't
 find anything related in the API.

 Thanks,

 --
 Adriano


Re: Is update_profile_background_image not working?

2008-11-23 Thread natefanaro

If you're getting a 200 back I believe your request sent to twitter is
correct. Go to Settings - Design - Change background image. You
should see your uploaded image. Twitter is not showing custom
background images updated through their api if a theme is selected.
Unfortunately the only way to display the background image is to
manually select it while logged in. I am running in to a similar
situation when changing any of the design colors.

On Nov 22, 5:46 pm, Max [EMAIL PROTECTED] wrote:
 Hey guys -

 Working with the newish APIs for setting themes, and for some reason
 update_profile_background_image is not setting the image.  A couple of
 things:

 - I believe my multipart is correct because I can use the exact same
 request body to update my avatar using update_profile_image
 - The response coming back is the equivalant of a show (that is, I am
 not getting any response other than a 200).

 Also is there any timeline on the tile bit from October?

 Thanks guys -

 -Max