LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-03-2007, 06:10 AM   #1
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
adapting wordpress functions for other webpages. RSS, php


I want a "box" on my site that displays my most recent twitter post. I don't want to use the twitter provided code as it causes lag on site load time.

Solution I have seen: Paul's very groovy site. Problem, he uses Wordpress. (I use bBlog, if that helps) Glimmer of hope: the one I want to use, twitterrss (text file of php code) is GPL, so I can derive from it.

Now, this is my understanding of the problem (and solution):
You have the RSS feed from your Twitter account. Use magpie rss to pull the feed in and cache it so we don't annoy anyone by constantly checking the feed. Get the most recent item. Strip off what we don't want, show the result. (this is pretty twitterrss specific.)

So, I put the relevant files, the magpie rss (I believe this is installed correctly) and edited the twitterrss.php file to my details and put it in the public_html directory. (http://www.creativehedgehog.com/twitterrss.php

As you can see, that page is blank. How do I display the results? I assume that "function" is general php and not word press specific.

thanks heaps- my php is very very flakey.

titanium_geek
 
Old 11-04-2007, 05:04 AM   #2
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Original Poster
Rep: Reputation: 50
please help me debug this! this is the code:

Code:
<html>
<head>
<title>PHP test twitter page</title>
</head>
<body>
<p>

<?php
require_once('magpierss/rss_fetch.inc');
$num_items = 1;
$url = 'http://twitter.com/statuses/user_timeline/6586832.rss';
$rss = fetch_rss($url);

$items = array_slice($rss->items, 0, $num_items);

foreach ( $items as $item ) {
  echo  '$item';
}

?>

</p>
</body>
</html>
the output:
Code:
items, 0, $num_items); foreach ( $items as $item ) { echo '$item'; } ?>
thanks!

titanium_geek
 
  


Reply

Tags
php, rss


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to make RSS better with PHP LXer Syndicated Linux News 0 12-07-2006 02:54 PM
Installing WordPress on FC5 - Mysql / PHP problem ArthurDent Fedora 1 06-25-2006 04:58 PM
LQ js.php rss feed slackhack LQ Suggestions & Feedback 3 12-05-2005 01:01 PM
RSS Generator using PHP willysr Programming 0 08-27-2004 09:41 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM


All times are GMT -5. The time now is 02:49 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration