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.
So, 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, 427 hits)
Open pligg.tpl, locate /body and add the following before:
<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:
Save and close.
Now, create a file called twitterstream.tpl and add the following to it:
<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
Related Search:
- dericeket info
- www dericeket info







