Written: July 14, 2009

Adding a Twitter Feed with PHP

At my marketing web site www.marketingeda.com I wanted to add a Twitter feed using PHP and found something at twitter.slawcup.com/twitter.class.phps that does just that.

The PHP coding is very simple to use with this class:

include_once(‘classes/class.twitter.php’);

$t = new twitter;
$t->username = ‘marketingeda’;
$t->password = ‘********’;

$data = $t->userTimeline();

foreach($data as $tweet) {
print “<li>$tweet->text</li>
“;
}

Here’s the output result of this PHP script:

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Adding an RSS Feed with PHP


I have a marketing web site at www.marketingeda.com and when I updated from PHP 4 to 5 my RSS feed reader stopped working. So I browsed for a simple replacement that worked well with PHP 5 and found something called MagpieRSS at SourceForge that worked wonderful.

Here’s the simple PHP code that I needed to insert on my page where I wanted the RSS feed to appear:

require(‘classes/rss/rss_fetch.inc’);
$rss = fetch_rss(‘http://www.chipdesignmag.com/payne/feed/’);
foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];
$description = $item[description];
echo “<a href=$url>$title</a></li><br>$description<br>”;
}

1
<br />

Here’s what this feed outputs on my page:

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

YouTube video added for AMA

The American Marketing Association – Oregon Chapter organized an annual conference, then made this cool video to recap the value of attending. I’m the webmaster at www.ama-pdx.org

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Blog Tags

Recent Posts

Blog Directory & Business Pages at OnToplist.com