Adding a Twitter stream to Pligg

The hottest things online right now is social media, namely Digg style websites and Twitter.  With so many Digg style websites going up these days, it’s important to try and stand out from the pact and your niche.

Twitter streamingSo, why not put the power of Twitter to work for you?  A friend of mine suggested perhaps a Twitter stream in the sidebar.  This sounded great, but let’s make it even better.  I have one setup on FAQPAL, I decided to use as a reward for active members.  On FAQPAL, for each member that submits 3 tutorials their name is added, as long as the submissions are recent.

You can use whatever requirements you want, but you get the idea.  By using the method I have, this offers my users one more reason to submit, not only will the submission be promoted, but everything they tweet will also be promoted in my sidebar.

Here’s how to add it to your Pligg install:

Download and upload the following to your /js folder:

  Twitter Stream JS (6.4 KiB, 281 hits)

Open pligg.tpl, locate /body and add the following before:

{literal}
<script type="text/javascript"><!–
  var rpnetTwitAttrs = {
    usernames: "Pliggs,Grafpedia,dennysugar,bkmacdaddy",
    count: 5,
    title: "Twitter Stream",
    showImages: true,
    imageHeight: ‘48px’,
    imageWidth: ‘48px’
  };
// –></script>
<script type="text/javascript" src="http://www.domain.com/js/TwitterWidget.js">
</script>
{/literal}

make sure you change the domain.com to whatever your url is.  The values for “username” can be changed to whatever Twitter id’s you want to display.

Open sidebar.tpl and add the following line where you want the stream to appear:

{if $pagename neq "story"}{assign var=sidebar_module value="twitterstream"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}{/if}

Save and close.

Now, create a file called twitterstream.tpl and add the following to it:

<div class="tlb">
        <a id="rpnet_twTitle" href="#">Twitter Stream</a></div>
<div id="rpnet_twitterWidget">

Get your username listed here by <a title="Submit a tutorial" href="http://www.domain.com/submit">submitting tutorials</a></div>

Again, be sure to change domain.com to whatever your url is.

Save and upload to your sidebar_modules directory.

That’s it.

Notes:

Because of Twitter’s API limitations on the number of API calls in one hour, the stream may appear blank after a while, depending on the traffic to your site, if it does, you will need to wait until the hour is up.  I am hoping to have a cache feature added it to soon to prevent time outs.

The original idea came from our friends at Ronak Patel

If you haven’t added us on Twitter, you can find us at @Pliggs

If you enjoyed this post, make sure you subscribe to my RSS feed!

  • I had been utilizing twitter to study new posts of my twitter pals. Haven't seriously applied twitpic that significantly.
  • I had been utilizing twitter to go through new posts of my twitter close friends. Haven't seriously utilized twitpic that a lot. Thanks for sharing anyway.
  • I had been using twitter to read new posts of my twitter friends. Haven't really used twitpic that much. Thanks for sharing anyway.
  • I signed up to a similar service named Twitxr, but I haven't really used it much since I find Twitpic easier to use I guess. But in twitxr you can add your friends.
  • if you ticked that box, would you see photos and videos posted from every single Twitter account?
  • This is great api for using. Good to use and works fine.
  • now this one is easy reallY!
  • The wcode work nicely. Thanks
  • Thanks for a great article! We at 140 Proof are thrilled to welcome HootSuite to the Proof Network today. HootSuite is an awesome company that amazes me with their ability to consistently produce great work.
  • How does everyone get there updates from twitter to there myspace status yes i looked it up how to and stuff but twitter changed so its not even a option in anymore.. any other choices...
blog comments powered by Disqus