thank you very much for your attention, i'm such a noob i thought
tokens would expire :|

On 21 Gen, 17:31, "Knutsford Software" <i...@knutsford-software.co.uk>
wrote:
> ----- Original Message -----
> From: "juri" <juri.pe...@gmail.com>
> To: "Twitter Development Talk" <twitter-development-talk@googlegroups.com>
> Sent: Friday, January 21, 2011 4:00 PM
> Subject: [twitter-dev] [PHP] Automatic tweets from a site?
>
> > Hello there,
> > i am wondering if it's possible to send automatically tweets from a
> > predefined account with PHP.
>
> > Basically i have a site in which users create content and i'd like to
> > automatically tweet from the site's account like "user xxx just made
> > content yyy, check it out at urlurl" whenever something new is
> > created..
>
> > I couldn't find anything similar online, but many oauth tutorials that
> > actually aren't what i need (my login credentials have to be unknown
> > to the users, of course).
>
> > is it possible? xAuth might be the way?
>
> Yep it is. I have done it
>
> include 'lib/EpiCurl.php';
> include 'lib/EpiOAuth.php';
> include 'lib/EpiTwitter.php';
> include 'lib/secret.php';
>
> $twitterObj = new EpiTwitter($consumer_key, $consumer_secret, $oauth_token,
> $oauth_token_secret);
>  $twitter_message = utf8_encode($twitter_message);
>
>  $x = $twitterObj->post_statusesUpdate(array('status' => $twitter_message));
>
>  if ($x->id) {
>
>  } else {
>       if ($x->response[error] <> "Status is a duplicate.") {
>            echo "Error Posting Tweet - " . $x->response[error];
>            die();
>       }
>  }
>
> secret.php' contains
>
> <?php
>     $consumer_key = ' Whatever the key is ';
>     $consumer_secret = 'Whatever the secret is';
>     $oauth_token = "Whatever the token is";
>     $oauth_token_secret = "Whatever the token secret is is";
> ?>
>
> Pam

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

Reply via email to