SEO Implications of Embedded Twitter RSS

RJM62

Touchdown! Greaser!
Joined
Jun 15, 2007
Messages
13,157
Location
Upstate New York
Display Name

Display name:
Geek on the Hill
I have a client who wants me to embed his Twitter RSS feed onto his Web site for SEO purposes (freshness of content).

Twitter limits API calls severely enough that on this guy's site (~30,000 pageviews / month), they would stop accepting API calls.

I can get around that by caching the XML and only calling it from Twitter every 15 minutes or so. (In fact, I have tested such a script and it works.) But that means that everything on the site will be delayed, and will have appeared first on Twitter's page.

So... am I doing him any favors by embedding his Twitter RSS on his site? Would he benefit from regurgitating his Twitter feed, or might it actually hurt him?

There are other options (and he would be willing to pay for them, but I don't want to take advantage of him). One would be to write a stripped-down, Twitter-like application that would accept input from a single user, and write that input to the Web page. Not brain surgery, but tedious and time-consuming unless I can find a canned script and tweak it.

I'm getting different answers to this from colleagues. I'm curious to know what people here think.

Thanks,

Rich
 
Cache just the feed info. Why does "everything on the site" have to be delayed?

That was badly worded on my part.

What I mean is that the feed info, having been cached, will always be delayed on his site, compared to when it appeared on Twitter's site. So search engines could construe it as copied content.

Sorry.

-Rich
 
I tried something like that, but the repeated calls cause Twitter to stop responding in very short order.

What I'm playing with now is based on this idea, which I found since I posted the original post. The caching reduces the calls to a level acceptable to Twitter.

-Rich
 
The technical part is actually the easy part, for a change.

My question is more about whether reposting material that already appears on his twitter page is likely to help SEO, or whether it would be worthwhile to build a new script that his guys in the field can use to upload "tweet-like" short messages to a database, from whence they would be output to a RSS-like feed on his site.

I'm starting to lean toward the latter, or maybe using something like Statusnet and hiding their page from the bots so it doesn't get indexed, this way the feed on the site would be the freshest existence of that content.

It also would be easy enough to hand-code something, though. Just a database and a simple interface that can be accessed from a mobile device. It doesn't have to be a true SMS-aware system to meet his needs.

It also could probably be done by email, but that opens up security risks if a robot happens to pick a random string that matches the address. I can just imagine the ads for pumps, patches, pills, and other peni-phernalia coming up on his site... It could be overcome by a filter that only accepts mail from known addresses, I guess; but why do all that work when a simple web form can be used?

But why do any of it if a Twitter feed will work? I'm just thinking that adding the RSS feed from Twitter will assure freshness of content, but it's not really unique content once it appears on their Twitter page.

-Rich
 
Last edited:
LOL. I have a follower on the test account I set up at Twitter. Who in their right mind would want to follow me? I bore myself!

-Rich
 
For the non-web folks here, SEO = Search Engine Optimization.

Rich, if your client thinks that a search engine is going to index his page higher for content keywords that are fleeting (status updates), I think he's going to be disappointed. Especially if, as you indicate, there are many updates.
 
He's an animal control guy. He has 18 other guys running around the state trapping things. He figures his field supervisors can tweet where they are and what they're doing a few times a day, which will improve the freshness of content.

I have to say, he may have a point. Freshness of content means a lot. My own site (for the tech support / repair side of the business) jumped three pages on Google, and is now coming up No. 1 or No. 2 on Page 1 for "computer repairs [localities]".

The difference? I added a PHP widget that displays the current weather. It grabs the weather in real time from Yahoo every time any page is loaded. Go figger.

My only dilemma with regard to my client is whether the content is really "fresh" if it's already appeared on Twitter. He pays me > $15,000 / year to keep him up in the rankings, and I don't want to do anything but the best for him.

-Rich
 
Last edited:
I might add, he gets his money's worth. He's No. 1 or No 2. in all of his markets.
 
This is very simple, but may work better for my client. It's a simple script to allow his field supervisors to upload tweet-like messages, which can then be displayed on the site.

It's a little unorthodox because it's designed to be easy to use on a mobile device (they use Blackberries). So, for example, the password field is not obfuscated.

The JS is to limit the character input, although I have to test it on an actual Blackberry to see if it works:

PHP:
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Upload Message</title>
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } else {
        limitCount.value = limitNum - limitField.value.length;
    }
}
</script>
</head>
<body>
<form action="tweet.php" method="post">
  <label>UserName<br />
  <input type="text" name="user" />
  </label>
  <p>
    <label>Password<br />
    <input type="text" name="pass" />
    </label>
  </p>
  <p>
    <label>Message<br />
    <textarea name="message" cols="30" rows="6" onKeyDown="limitText(this.form.message,this.form.countdown,180);" 
onKeyUp="limitText(this.form.message,this.form.countdown,180);">
</textarea>
    <br>
    <font size="1">(Maximum characters: 180)<br>
    You have
    <input readonly type="text" name="countdown" size="3" value="180">
    characters left.</font><br></font> </label>
  </p>
  <p>
    <input type="submit" name="Submit" value="Submit" />
  </p>
</form>
</body>
</html>
The input is then validated and saved to a database:

PHP:
<?php
session_start();

// check for cookie
$sessid = $_COOKIE[PHPSESSID];
    if ( !isset($sessid) ) {
    // redirect to login page if cookie not found
    print "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
    die;
    }

// get variables
    $user = strip_tags(substr($_POST['user'],0,15));
    $pass = strip_tags(substr($_POST['pass'],0,15));
    $message = strip_tags(substr($_POST['message'],0,180));

// start over if either fields is empty
if ( (empty($user)) || (empty($pass)) || (empty($message))) {
     print "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
     die;
    }

// check db
$con = mysql_connect("localhost","critters_tweeter","password");
if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("critters_tweeter", $con);
    $result = mysql_query("SELECT * FROM users WHERE userName = '$user'");
    $row = mysql_fetch_array( $result );

// check that user exists
if(empty($result)) {
     echo "User " . $user . "not found!";
    mysql_close;
    print "<meta http-equiv=\"refresh\" content=\"5;URL=index.php\">";
    die;
    }

$passWord = $row['passWord'];
$realName = $row['realName'];

// check password
if ($pass !== ($passWord)) {
    echo "<p>Authentication Failed!</p>";
    mysql_close();
    print "<meta http-equiv=\"refresh\" content=\"5;URL=index.php\">";
    die;
    }

// get time
putenv("TZ=US/Eastern");
$timeSubmit = (date("M d, Y h:i a"));
 
// post message to db
mysql_select_db("critters_tweeter", $con);
$sql = "INSERT INTO messages (Message, User, timeSubmit)
    VALUES ('$message','$user','$timeSubmit')";
    
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "Message added!";

mysql_close($con)
          
?>
And from there it's a simple thing to pull the data out and echo it on the site.

It's a little rough, but it's also three in the morning. I'll look at it in a few hours and maybe put a demo up. But it does work.

-Rich
 
And here's the page that prints it to the Web:

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Result</title>
<link href="tweet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: 24px}
.style2 {font-size: 24px; color: #FFFFFF; }
-->
</style>
</head>

<body>
<p>&nbsp;</p>
<div align="center">
  <p class="style2">Demo Page</p>
  <p class="style1">&nbsp;  </p>
</div>
<div id="Tweets">
<?php
// check db
$con = mysql_connect("localhost","critters_tweeter","password");
if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("critters_tweeter", $con);
    $result = mysql_query("SELECT * FROM messages ORDER BY timeSubmit DESC LIMIT 6");
    $row = mysql_fetch_array( $result );
    $num = mysql_num_rows( $result );
$i=0;
while ($i < $num) {

// assign variables
    $message = mysql_result($result,$i,"Message");
    $timePosted = mysql_result($result,$i,"timeSubmit");
    $name = mysql_result($result,$i,"realName");
    
// print output

echo $message . "<div id='MessageID'>—Posted by " . $name . "<br />on " . $timePosted . ".</div><br />";
$i++;
}
?>
</div>
</body>
</html>

It's really simple, but I think it'll serve the purpose. Simple is good. Fewer problems crop up with simple.

I also think this is the way to go for SEO. This way there's no worry about whether the content is truly original once it's been published on Twitter.

-Rich

EDIT: The client approved the script, so I have taken down the demo page.
 
Last edited:
That's a nice thing to wake up to after a long night coding!:yesnod:

Indeed. But there was a bug. Sorting by timeSubmit was unreliable, so I added an integer field for "messageID" in the db and set it to auto-increment.

So

PHP:
$result = mysql_query("SELECT * FROM messages ORDER BY timeSubmit DESC LIMIT 6");


becomes

PHP:
$result = mysql_query("SELECT * FROM messages ORDER BY messageID DESC LIMIT 6");

That works reliably.

-Rich
 
Here's a working demo you can play with, if you're really bored.

I made a deal with the client to sell him a permanent license at a token price, but I retain ownership so (hopefully) I can sell it as an add-on to existing sites.

-Rich
 
http://apiwiki.twitter.com/Rate-limiting
Considering how you can make 150 calls to Twitter per hour, I don't see the problem You could do an API call every minute and be fine. A million different ways to cache the data.

You might even be able to do something with their Streaming API to get it nearly instant: http://apiwiki.twitter.com/Streaming-API-Documentation

Thanks, Jesse.

Yeah, I know 150 an hour is what the guidelines say. But my experience was different.

I was getting cut off after 15-20 minutes on a test page that no one except me was hitting. I assumed that maybe there were multiple calls required for each file transaction. But if you're telling me that was not likely the case, then perhaps they were having problems that day and the service kept going down. I'm told it's not the most reliable service in the world...

To get around the call limit problem (if that's what it was), I built three different caching versions of the script. Once tried to check Twitter's server (using PHP filesize) for changes on every page load. That didn't work. Could have been my coding, but whatever the case, I never did get a reply.

Then I built two other caching versions that did work, one by checking the age of the locally cached XML file on every page load and downloading a new one if it was more than 15 minutes old, and one that just pulled it from Twitter every 15 minutes regardless. They both worked and would have been perfectly usable.

But then I started to wonder about the SEO value of the content, since it was essentially identical to what appeared on Twitter already. This was all about SEO to begin with.

I got to thinking that it would be better to build a private app that did the single job of putting "tweets" on a page. The content would be unique, it would be instantaneous, and it wouldn't rely on someone else's service. It also was easy to code, and in the end I like the way it does that one job.

I should say that I never used Twitter before, so like I said, perhaps they were just having repeated outages the day I was testing scripts. If you think that was more likely the case, then I'll change my page copy based on your advice. I assumed I was hitting limits. But if that's not true, then I want to change it just to be honest.

--Rich
 
I should say that I never used Twitter before, so like I said, perhaps they were just having repeated outages the day I was testing scripts. If you think that was more likely the case, then I'll change my page copy based on your advice. I assumed I was hitting limits. But if that's not true, then I want to change it just to be honest.

--Rich

And then you could label it CritterTwitter on the page, without worries of being sued... :D
 
And then you could label it CritterTwitter on the page, without worries of being sued... :D

Actually, I did already. :yikes: Your suggestion was too irresistible. :D

I also decided "twitter" was generic enough that the first time they sue someone for infringement, they'll probably lose.

-Rich
 
Back
Top