PHP class or library that allows you to tweet from a website

I know that there are quite a few libraries that allow Twitter to be integrated into the website. But I haven't found what I was looking for yet (or maybe my understanding of the twitter API is missing). I want to be able to tweet events that occur on my site - BUT, in addition, I want to be able to add tweets from www.example.

For example, when I send tweets from my blackberry or iphone (or, indeed, from some other sites), under the tweet, there is a message that says twitter from (for example, blackberry). Does anyone know of a library or PHP class that allows me to send tweets, but also with some kind of “signature” that says where the tweet was sent from?

Edit

In addition, I want users to be able to tweet from my site. When they are tweeting, I would like the tweet to say where it came from (for example, like for Blackberry phones, etc., as I described above).

I don’t understand if I need a PHP application for this requirement, as well as how to implement it. Do I need an additional library that allows users to tweet from my site?

Note. My users do not access my site using twitter login, so my site does not have access to the username / password of users, etc.

+5
source share
3 answers

http://twitter.com/apps, twitter → http://classes.verkoyen.eu/twitter_oauth

, http://blog.cmstutorials.org/reviews/general/how-to-update-your-twitter-status-using-php, ,

:

, URL-, 140 charachters :

function getBitlyUrl($url)
  {
                $bitlylogin = 'your login name';
                $bitlyapikey= 'your api key';
                $bitlyurl = file_get_contents("http://api.bit.ly/shorten?version=2.0.1&longUrl=".$url."&login=".$bitlylogin."&apiKey=".$bitlyapikey);
                $bitlycontent = json_decode($bitlyurl,true);
                $bitlyerror = $bitlycontent["errorCode"];
                if ($bitlyerror == 0) {
                $bitlyurl = $bitlycontent["results"][$url]["shortUrl"];
                }
                else $bitlyurl = "error";
                return $bitlyurl;
  }

:

$url = getBitlyUrl('yourlink');

$url

+3

. ( API) . " XYZ" .

http://www.twitter.com/apps

+1

http://dev.twitter.com

( "" URL- )

:

http://dev.twitter.com/pages/libraries#php

https://github.com/abraham/twitteroauth https://github.com/basilbthoppil/oauth_twitter ( oauth. , twitter )

php script, ( , , ).

Any tweet posted using the library will contain information about tweets, etc.

+1
source

All Articles