Thanks got it working. Here is my final code in case others might find it useful.
<?php $tweet_lottery_txt = 'Tweet Text, etc. etc. Retweet/post a link to your tweet @'; ?>
I am trying to do this as well. And this code works. BUT, I am also trying to customize the Tweet button. Using an image of my own.
I am using the following code.
with the following javascript
hola quisiera aser lo mismo que esto
pero con Follow Button
Do we have a sign in api for twitter…?
Means i am having my own website and i want user to have a choice either to login through facebook account or twitter account…i got facebook login api…nw i am searching for twitter sign in api…can u help me…
kurrik
#9
Yes, the sign in with Twitter flow is documented here: https://dev.twitter.com/docs/auth/sign-in-with-twitter
How did you get it to work?
even i did it.thanx a lot.
Link
I am using this code to tweet . But i am facing a problem. When i load the page it gives me error ‘event not defined’ in code twttr.events.bind(‘tweet’, clickEventToAnalytics(event)). Some body help me please.
episod
#13
You may want to wait until the document’s “ready” before binding events with intents – additionally, if you want to take advantage of the event tracking, you should allow widgets.js to take care of the pop-up for you – by handling the pop-up through window.open yourself. you can disrupt your ability to further track the events.
I am using this code for get data from twitter. i hop is helpful
<?php
require("twitter/twitteroauth.php");
require 'config/twconfig.php';
session_start();
$twitteroauth = new TwitterOAuth(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET);
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$request_token = $twitteroauth->getRequestToken('http://yourwebsite.com/getTwitterData.php');
// Saving them into the session
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
// If everything goes well..
if ($twitteroauth->http_code == 200) {
// Let's generate the URL and redirect
$url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
header('Location: ' . $url);
} else {
// It's a bad idea to kill the script, but we've got to know when there's an error.
die('Something wrong happened.');
}
?>
twttr.events.bind('tweet', clickEventToAnalytics(event));
yes, it work fine. But I cant get new tweeted ID. please how to get new Tweet ID.
I see at the url return after tweet complete on popup window has Tweet ID.
pls how to get it ?
thanks so much !
I tried your code but in IE, the twttr.events.bind(‘tweet’, function(event) {} is not being fired. Are you experiencing the same? In IE, I am not redirected.
Why does not a simple alert?
por que no funciona un simple alert?
Tweets sobre “#ConVoluntad”
yo lo mismo pero con twitter-timeline osea, no funciona desde el boton twett del box de twitter-timeline, es una mierda estoy recaliente y no hay una puta referencia
Thanks a lot…
can i know do it have auto tweet???
hi guys, i had followed instruction. but it didn’t work for me
this is my code
Follow @xxxxx
Thanks
<?php
session_start();
require_once(“twitteroauth/twitteroauth.php”); //Path to twitteroauth library
$twitteruser = “@XXXXXX”;
$notweets = 30;
$consumerkey = “XXXXXXXXXXXXXXX”;
$consumersecret = “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”;
$accesstoken = “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”;
$accesstokensecret = “XXXXXXXXXXXXXXXXXXXXXXXXXXX”;
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = $connection->get(“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=”.$notweets);
echo json_encode($tweets);
?>