Jump to content

Search the Community

Showing results for tags 'twitter'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 13 results

  1. This twitter style button I found. http://jsfiddle.net/jakie8/ZECEN/ I have managed to modify it to my liking. And yes I know the ".live" is depreciated and instead use "on". Anyways, the only thing I noticed is that if I click "Follow" button and it turns green; once I refresh the page, it goes back to default "follow" mode. I was wondering how can I keep it green even if I refresh the page?
  2. Good day Campers! Having spent the better part of my day trawling the internet for an answer I have gotten nowhere so have come to you lovely people for help. I found a nice little tutorial on PHP gang that would allow me to update my twitter feed from my website using PHP and OAuth. I set up my twitter app with no issues and generated the API keys. Set the App to 'read/write' permissions and then regenerated the keys The app is marked to "Allow this application to be used to Sign in with Twitter" The issue is that when I click the little button to sign in to twitter, the page redirects but displays the generic "Cannot connect to Twitter" error message that has been defined in the code. I do not get asked to "Allow" the script to connect to twitter like it seems to do in the demo. The PHPGang solution has 4 bits of script so I'm wondering if it has something to do with this as I understand the Abrahams script has slightly more so I do wonder if something is missing. I'm not sure. One of the main problems I am facing is that I have never actually done this before so I don't know where I have gone wrong or what I am even looking for help wise...... I have the following scripts: callback.php <?php /** * Take the user when they return from Twitter. Get access tokens. * Verify credentials and redirect to based on response from Twitter. */ session_start(); require_once('oauth/twitteroauth.php'); require_once('config.php'); if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) { $_SESSION['oauth_status'] = 'oldtoken'; header('Location: ./destroysessions.php'); } $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']); //save new access tocken array in session $_SESSION['access_token'] = $access_token; unset($_SESSION['oauth_token']); unset($_SESSION['oauth_token_secret']); if (200 == $connection->http_code) { $_SESSION['status'] = 'verified'; header('Location: ./index.php'); } else { header('Location: ./destroysessions.php'); } ?> config.php <?php /** * @file * A single location to store configuration. */ define('CONSUMER_KEY', 'MY CONSUMER KEY'); define('CONSUMER_SECRET', 'MY SECRECT CONSUMER KEY'); define('OAUTH_CALLBACK', 'URL OF WHERE I AM REDIRECTING TO'); ?> destroysessions.php <?php /** * @file * Clears PHP sessions and redirects to the connect page. */ /* Load and clear sessions */ session_start(); session_destroy(); /* Redirect to page with the connect to Twitter option. */ header('Location: ../index.php'); ?> index.php <?php require_once('oauth/twitteroauth.php'); require_once('config.php'); if(isset($_POST["status"])) { $status = $_POST["status"]; if(strlen($status)>=130) { $status = substr($status,0,130); } $access_token = $_SESSION['access_token']; $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']); $connection->post('statuses/update', array('status' => "$status")); $message = "Tweeted Sucessfully!!"; } if(isset($_GET["redirect"])) { $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); $request_token = $connection->getRequestToken(OAUTH_CALLBACK); $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; switch ($connection->http_code) { case 200: $url = $connection->getAuthorizeURL($token); header('Location: ' . $url); break; default: echo '<div class="par">Could not connect to Twitter. Refresh the page or try again later.</div>'; } exit; } if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) { echo '<a href="./index.php?redirect=true"><img src="./images/lighter.png" alt="Sign in with Twitter"/></a>'; } else { echo "<a href='destroysessions.php'>Logout</a><br>"; echo '<div class="par">'.$message.'<div> <form action="index.php" method="post"> <input type="text" name="status" id="status" placeholder="Write a comment...."> <input type="submit" value="Post On My Wall!" style="padding: 5px;"> </form>'; } ?> Now, I am unsure if there is anything wrong with the API keys I have generated or if there is something missing. Is there anyone who can point me in the right direction or offer some advice on where to turn? Thanks!
  3. I was wondering if you could help me. I am currently trying to use the 'GET users/show' command in the Twitter API, however it is not working. Can anyone see where I am going wrong? <?php include "library/twitteroauth.php"; ?> <?php $consumer = "key"; $consumersecret = "key"; $accesstoken = "key"; $accesstokensecret = "key"; $twitter = new TwitterOAuth($consumer, $consumersecret, $accesstoken, $accesstokensecret); $tweets = $twitter->get('https://api.twitter.com/1.1/users/lookup.json?screen_name=twitterapi,twitter'); ?> <html> <head> <meta charset ="UTF-8" /> <title>Twitter Search</title> </head> <body> <form action="" method="post"> <label>Search: <input type="text" name ="keyword"/> </form> <?php if ( isset($_POST['keyword'])){ $tweets = $twitter->get('https://api.twitter.com/1.1/users/lookup.json?screen_name='.$_POST['keyword']. ''); foreach($tweets as $tweet){ foreach ($tweet as $t){ echo ($t->text); } } } ?> </body> </html>
  4. im using twitter api, when i post a status in twitter, i got fatal error like Fatal error: Uncaught exception 'EpiTwitterNotAuthorizedException' with message '{"errors":[{"message":"Could not authenticate you","code":32}]}' in pls give the solution
  5. I am looking for a programmer that can design several custom twitter bots for me. I am willing to pay for each bot made.
  6. Hi, first I'm sorry if I posting this in wrong forum - and sorry for my bad english. I want to make RewriteRules like Twitter - So that the files are displayed as Virtual folders, but if you add the file extensions (.php) he shouldn't view this file! .htaccess edit: AddDefaultCharset UTF-8 Options +FollowSymlinks Options -Indexes Options -ExecCGI <FilesMatch "^\." > deny from all </FilesMatch> RewriteEngine on RewriteBase / RewriteCond %{SERVER_PORT} !=443 RewriteRule ^(.*)$ https://www.abc.com/ [R=301,L] RewriteRule ^profil/$ profil.php?ID=$1 [NC,L] RewriteRule ^([^.]+)/([^.]+)/$ $2.php?ID=1 [NC,L] Can anyone help me?? Best regards Termi
  7. How can I retrieve the latest tweets for multiple users on Twitter and display them in one feed? I can only seem to find ways to pull one account using the API v1.1 How do I go about doing this?
  8. I have a php script that uses the old key and token auth to auto tweet to Twitter. Since jan 14th this has been replaced by a new method by Twitter. Please can someone help me by explained how I can simply change my standard auth script to the new style. I have looked at help pages and twitters own guide but it is way over my head. I need a dummies step by step explanation. Is it easy?
  9. Hi guys I'm happy to be a member of this forum i am wondering if there is a way to get new notifications using Twitter API this exists in facebook (i use facebook-sdk) , Twitter has some libraries for that too , but i can't find anyone that can get Twitter new notifications so any suggestions ? and does twitter work like facebook ? i mean does it have notifications too ? because i don't use it at all thanks
  10. At present I have wrote the code below to parse Twitter hashtags "#emotionalclothing". What I really want to do is parse hashtags or status updates with any instance of the phase "emotionalclothing". So say there's a word that reads "blahemotionalclothingblah" in a status update how could retrieve that status update just by searching for a regex with "emotionalclothing" in it? Here's my code so far: Thanks Stuart <?php $pagetitle = "Pull Twitter Hashtags"; function getTweets($hash_tag) { $url = 'http://search.twitter.com/search.atom?q='.urlencode($hash_tag) ; echo "<p>Connecting to <strong>$url</strong> ...</p>"; $ch = curl_init($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE); $xml = curl_exec ($ch); curl_close ($ch); //If you want to see the response from Twitter, uncomment this next part out: //echo "<p>Response:</p>"; //echo "<pre>".htmlspecialchars($xml)."</pre>"; $affected = 0; $twelement = new SimpleXMLElement($xml); foreach ($twelement->entry as $entry) { $text = trim($entry->title); $author = trim($entry->author->name); $time = strtotime($entry->published); $id = $entry->id; echo "<p>Tweet from ".$author.": <strong>".$text."</strong> <em>Posted ".date('n/j/y g:i a',$time)."</em></p>"; } return true ; } getTweets('#emotionalclothing'); ?>
  11. I'm a big fan of Big Brother UK and as a fun project I have built a Twitter hash tag counter to count the battle between the contestants this year. Using the API from Topsy.com I have built a counter that shows the amount of tweets daily, monthly and hourly. However, I wondered if it was possible for me to calculate the amount of tweets say between the time the page was loaded and the time a user clicks stop so I can see how the numbers have change during the show. Would it be possible to use the setTimeOut() function or is there a better way of doing this? heres my code: <?php error_reporting(0); $jsonurl = "http://otter.topsy.com/searchcount.json?q=%23teamrylan&type=tweet&apikey=FJWCK5YSZIBEUZX4HYJQAAAAABLTPFQ3DVIQAAAAAAAFQGYA"; $json = file_get_contents($jsonurl, 0, null, null); $json_output = json_decode($json, true); $json_output = array_values($json_output); foreach ($json_output as $key => $val) { $hourly = number_format($val["h"]); $daily = number_format($val["d"]); $weekly = number_format($val["w"]); $monthly = number_format($val["m"]); $alltime = number_format($val["a"]); } echo '<strong>How many times have people tweeted #TeamRylan</strong><br /><br />'; echo 'In the last Hour: ' . $hourly . '<br />'; echo 'In the last Day: ' . $daily . '<br />'; echo 'In the last Week: ' . $weekly . '<br />'; echo 'In the last Month: ' . $monthly . '<br />'; echo 'Ever: ' . $alltime . '<br />'; ?>
  12. Hey guys. I'm new here and pretty new to PHP. I know the basics of the language and can do most simple things, but I am working with Twitter in a project now and I have never worked with it before in terms of PHP. I have a PHP page that simply provides a link that the user clicks on to go to the Twitter page where they are asked to grant access to my application to use their Twitter. I do this through oAuth and this works as it should, returning a token. Upon granting access, a user is sent to a new PHP page which simply asks them to enter a search term. Once they enter a search term, I want to take that term and simply run it through the Twitter Search API. I then want to grab all of the IDs of the Tweets returned and store them. Here is the code that I have: <?php session_start(); ob_start(); include 'lib/EpiCurl.php'; include 'lib/EpiOAuth.php'; include 'lib/EpiTwitter.php'; include 'lib/secret.php'; $oauth_token = $_POST['authtoken']; $search = $_POST['searchterm']; $tweets = $_POST['tweets']; $url = 'http://api.search.twitter.com/search.json?q='.$searchterm; $twitterObj = new EpiTwitter($consumer_key, $consumer_secret); $twitterObj->setToken($oauth_token); $token = $twitterObj->getAccessToken(); $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret); $_SESSION['ot'] = $token->oauth_token; $_SESSION['ots'] = $token->oauth_token_secret; $twitterInfo = $twitterObj->get_accountVerify_credentials(); $twitterInfo->response; $creds = $twitterObj->get($url); ?> Now I'm stuck with what $creds is actually holding and how I will get the Tweet ID's out of it. I've tried a bunch of echo statements to attempt to figure it out, but I can't seem to get it. I feel like I'm close. Thanks for any help.
  13. Hello All, I wanted to start a conversation to get some thoughts on social media integration in a website. Pretty much effectively using social media plugins to generate conversation. I feel like throwing social media plugins into your design can lead to poor design. They do get kind of clunky and can be tough to style at times. I know about ShareThis, AddThis and Jtweetsanywhere, but does anyone else know of any other effective solutions, techniques or tools, for social media integration. Thanks,
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.