Member
From: Pell City, Alabama USA
Registered: 2004-11-17
Posts: 2084
I've been thanked 5 times.
Offline
[[Neo]] wrote:
@ M1
Actually, sir, as I put in post #125, the link http://www.the-spot.net/blot/test.php shows that your simple reader can be called multiple times, using the include() function for each of the feedid= urls. If you click the link, you'll see all the entries from http://thepizzy.net/blog?cat=17 first (of which are two), then you'll see the next 5 entries from the entire blog at http://thepizzy.net/blog and then you'll see the last 5 entries are the newest 5 of http://thepizzy.net/bluejournal . (Links provided for comparison and reference to the feed page, test.php )
This is not to discount your work on Example 3 and 4, but to show it can be done using the simple-reader as well.
Thanks for the info - thats good to know
yes you are right you can call it multiple times
Thanks for clearing that up
TombOfTheMutilated.NET - Destroying The Minds of America's Youth Since 2001
travelagent wrote:
I thought PHP & RSS would be easy to pick up ... but, I've easily and quickly demonstrated my ABSOLUTE STUPIDITY regarding both, as they're "scripting" languages written in C; Pearl; and Java -- languages I know nothing about, and am really getting too old to go "buy a book and learn".
You know, I think this is a valid point. I have talked to a lot of "hard core" programmers who hate PHP because it is a scripting language that is trying to imitate a programming language more and more. Obviously there are exceptions to the rule - some programmers love it. For myself, who is not a trained programmer, PHP is accessible enough for me to use because I don't think in terms of a strict program. I do find other programming languages like my brief foray into Ruby and Python to be a bit more challenging.
TA, because you have the background that you do, you might be interested in picking up Python. There is a free PDF out there called "Diving into Python". Its quite the read, but it is free and comprehensive. You could probably pick it up fairly easily.
Today's article: A Unique Look at Adwords Advertising
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
SiteReference wrote:
Wizard of Oz wrote:
What's a 'cache' (other than a little hideaway of goodies - usually 'illgotten')?
Well, its actually sort of like that - a little hideaway. Cache, in this case, is a locally stored copy of a page. In other words, instead of having the script go out, download the RSS feed, parse the code, then create the page, we create the page once, make a temporary file of it, and then serve that page up when asked for.
It saves on resources and makes the pages faster.
Thanks SR - I've seen the Google "Page Cache" next to each listing, which of course, is an 'archive' of the page the last time they 'scanned it' or 'did a visual take' take on it. So I see...
Does this procees have anything to do with, or occur at all, when I put the parse code (created on your RSS Parser) onto one of my php pages? I mean, is there a 'cache' of the 'bare' page stored somewhere on my server (or yours?) or wherever?
Thanks 
I cried because I had no shoes - until I saw a man who had no feet...
I put the .php file in a seperate folder and uploaded to my server, but every time i get the message "No news at present, please check back later"
I used the same code, didn't make any changes to the code.Did i make some mistake or is there no title to display.Please help
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
blackjava wrote:
Can any one tell me why so many people advertise using RSS feeds to get better search engine rankings and fresh content? RSS is absolutly useless for generating content that search engines can read. When will people get this?
I have a php page with an RSS feed attched to the bottom. The Google 'cache' and also the 'text only cache' have the RSS text from the day it was cached!
If it's not being read by the SE, why is it there in the cache?? This is the cache:
http://72.14.203.104/search?q=cache:NqK … k&cd=1
Steve
I cried because I had no shoes - until I saw a man who had no feet...
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
Well, blackjava, have a look at the cache URL I have on my previous post and you will see RSS TEXT in a Google Cached page! (in both the image cache AND the 'text only' cache).
It's true, blackjava, that RSS is USELESS and cannot be read if you use Java script to insertit into your site, but using php, it DEFINITELY shows up for the SEs and they READ IT.
Regards,
Steve 

I cried because I had no shoes - until I saw a man who had no feet...
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
I thinks it's not such a good thing for someone to so 'vehemently' rubbish a great resource - when they clearly don't know what they are saying. It's likely that people (of lesser experience especially), will accept as Gospel that RSS is "USELESS for SE rankings and fresh content (to paraphrase blackjava)".
I understand he thought he was correct and I also know what it's like to be so sure about something and to turn out to be wrong. That's not the problem. The problem is that it has to be corrected, so that people don't disregard RSS as a USELESS resource. It just needs to be used properly.
I believe Black's ideas may come from the fact that RSS IS USELESS if you use JAVA code to insert it into you site (because no SE can read java). In fact, of all the RSS feed, reader, parser etc sites, I have only come across ONE which makes this distinction in the Parser - This site.
RSS is great. Convert your page to php - insert the parser code (php version), and it will show up as html text in you page and it WILL be seen and read by the SEs and you will get the SE advantages of daily updated content. (of course the update intervals depend on the feed). Some are hourly, which is a bit silly for SE purposes as noone's site is crawled hourly. But if you have a good amount of traffic and a need to keep people informed up to the minute - hourly feeds are wonderful.
The Wiz has spoked! 


I cried because I had no shoes - until I saw a man who had no feet...
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
If you people are looking for a 6 year old's way (my way:)) of getting a php parsed RSS code onto your page to show uop as html, read this old post:
http://forums.site-reference.com/topic/1248//p#p1248
That's how I do it. And if I can do it, anyone can. Especially you blokes....

I cried because I had no shoes - until I saw a man who had no feet...
Member
From: Ohio USA
Registered: 2004-11-17
Posts: 670
I've been thanked 0 times.
Offline
Wizard of Oz wrote:
blackjava wrote:
Can any one tell me why so many people advertise using RSS feeds to get better search engine rankings and fresh content? RSS is absolutly useless for generating content that search engines can read. When will people get this?
I have a php page with an RSS feed attched to the bottom. The Google 'cache' and also the 'text only cache' have the RSS text from the day it was cached!
If it's not being read by the SE, why is it there in the cache?? This is the cache:
http://72.14.203.104/search?q=cache:NqK … k&cd=1
Steve
There's an even better way to see the php as html, just look at the source. The php will appear as content. I just didn't want to carry on a conversation that had potential for further misunderstanding - but I negelected to think of new people reading this misinformation.
You really should go back and read this whole thread Oz, and see the code and variations thereof. Very interesting.
Member
From: Fort Worth, TX
Registered: 2006-04-05
Posts: 15
I've been thanked 0 times.
Offline
I understand where your frustration was coming from. I've spent multiple 24-hr periods staring at code trying to figure out why it doesn't work, only to come back later, after thinking about it while doing other things, to figure it out....for several languages.
I've been messing with php since about late 2001, and didn't actually try to code any of it until late 2003, when I figured it HAD to be better than javascript's document.write() object-function for putting in "dynamic" content into a page. The way I learned: reading the code for phpbb forums, and changing things to see what happened. I saw the SQL statements, which taught me how to use SQL, and the templates, which taught me how to do CSS.
I've done C, Java, VB, PHP, JavaScript, SQL, HTML, CSS, and Software for TI-Calcs in Assembly (which is where I started learning code)...but I don't fully agree that PHP can't be viewed as a programming language (as SR mentioned), because it's Object Oriented, has the loops, can have function calls (or sub-routines) and you can use a library of pre-written codes (maybe some that other people wrote - mods, I guess - or ones that you write) to be used with the include() call. But you also get the power of html scripting, transferring the data to Java, and also storing the data in a database like SQL - that's the essence of "AJAX".
I'm not fluent in any of those languages (I was in Assembly for a while), but they all have similar characteristics (IMO) that help me link their abilities. I don't think you're too old to pick up PHP, it's just not going to happen over night (or 3 nghts
) if you've not had much experience with what's actually going on in the code (I just guessed that you MIGHT be able to call feedid= on your URL to get a particular feed, and it worked...lucky, huh?
)
I'm with droolin, come back to it later with a new perspective on it...give it some more logic-thought about how it should work, and what it should take...what should reference it, etc...and see if you can get it to work later, if it's something you might be interested in using on your site.
[[Neo]] wrote:
...but I don't fully agree that PHP can't be viewed as a programming language (as SR mentioned), because it's Object Oriented, has the loops, can have function calls (or sub-routines) and you can use a library of pre-written codes (maybe some that other people wrote - mods, I guess - or ones that you write) to be used with the include() call. But you also get the power of html scripting, transferring the data to Java, and also storing the data in a database like SQL - that's the essence of "AJAX".
I guess what I was trying to say is that PHP is a language that started out purely as a scripting language and is now trying to be a programming language. It has a lot of the features of a programming language (as you pointed out and as I use time and time again), but it is still a scripting language at heart. This makes it an odd duckling in the world of languages.
Today's article: A Unique Look at Adwords Advertising
Wizard of Oz wrote:
Thanks SR - I've seen the Google "Page Cache" next to each listing, which of course, is an 'archive' of the page the last time they 'scanned it' or 'did a visual take' take on it. So I see...
Does this procees have anything to do with, or occur at all, when I put the parse code (created on your RSS Parser) onto one of my php pages? I mean, is there a 'cache' of the 'bare' page stored somewhere on my server (or yours?) or wherever?
Thanks
Unfortunately there is not, although it would be a good idea for me to create a caching system. 
I have just learned how simple it is to create a caching system - and how incredibly useful they can be as well. It is something that I am definitely going to be checking into very closely in the near future.
Today's article: A Unique Look at Adwords Advertising
Member
From: Sydney, Australia
Registered: 2004-10-23
Posts: 593
I've been thanked 0 times.
Offline
Beatle wrote:
There's an even better way to see the php as html, just look at the source. The php will appear as content. I just didn't want to carry on a conversation that had potential for further misunderstanding - but I negelected to think of new people reading this misinformation
Yeah, I know you can see it in the source code and that's a perfect indication of what the SE sees and reads - However, I didn't want confusion, I wanted blackjava to actually see what Google sees. This way, there would be no "yeah, but's"
P.S. Blackjava - Don't feel I'm having a go particularly at you - not at all. It's just that it was way back in the posts and there was no correction, so I felt I needed to make the point good and clear for those who might stumble onto this thread down the line.
Anyway, as you said (half correctly) RSS is USELESS for content and SE ranking purposes IF using java, which is what most RSS feeds seem to promote - Most have their codes all ready for people to pop into their pages because it's so simple, but they don't tell anyone that, as you said, as Java, it's no good for these purposes.
Steve:D
I cried because I had no shoes - until I saw a man who had no feet...
As a point of clarification (and not to sound like a snob), but there is a huge difference between java and javascript. Just for future reference...:/
Today's article: A Unique Look at Adwords Advertising
Member
From: Fort Worth, TX
Registered: 2006-04-05
Posts: 15
I've been thanked 0 times.
Offline
I'll try to help you a bit differently this time...just take this post one section at a time...
__________________________
what you have had has always been right:
Code:
$RSSFEEDS = array(
0 => "http://www.site-reference.com/xml.php?c=all",
1 => "http://rss.cnn.com/rss/cnn_topstories.rss",
2 => "http://rss.slashdot.org/Slashdot/slashdot",
3 => "http://www.site-reference.com/xml.php?c=all",
4 => "http://rss.cnn.com/rss/cnn_topstories.rss",
5 => "http://rss.slashdot.org/Slashdot/slashdot",
);
(While that is going to call the same 3 feeds twice, it's still valid)
That array definition will go into your SimpleReader.php page. Go get a fresh version of SimpleReader.php script, and put in your array just like I have there...copy/paste it if you like.
_____________________
The reason you think you're seeing 3 feeds is not because it's only pulling 3 rss streams...it's that you're seeing 3 of the stories from the FIRST (the 0th element of the array) stream. If you scan downward in the code you'll see a comment that goes something like "we'll pull the first 3 stories from the feed". Change the variable definition to 5, and you'll see the top 5 stories. - but don't mess with that until you have the regular code working...then only mess with it after you make a back up of the working code.)
____________________________
What you need now, is a separate, and totally different file, located in a different folder if you want to make this more useful. Create a file in notepad, call it testpage.php.
____________________________
Inside testpage.php is where you'll use the include. Never put it in your SimpleReader. A file cannot include itself, or you will get (Though I don't know if it's possible) an infinite inclusion. The code will never finish executing, and just throw an error because it's including itself infinitely, never moving past the include statement.
Inside of testpage.php all you need to have is this:
Code:
<?php
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=0');
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=1');
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=2');
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=3');
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=4');
include('http://www.your-site.com/path/to/SimpleReader.php?feedid=5');
?>
Don't worry about CHMODing anything, don't worry about commenting anything out. Most directories are defaulted to 755, which is a writeable permisison by the owner of the directory (hence the 7 in the first slot) If your directory for the testpage.php page is not of the default type, then yes, at least make it 755.
____________________________
To recap:
- Get a new SimpleReader.php code, and put in your array of rss feeds like I posted above. Store that in some directory.
- Create a new page called testpage.php, store it in a different directory, and put in the code that I have given above, changing the url and the domain to match the location of the SimpleReader.php page.
- if necessary, CHMOD your testpage.php's directory to 755 - but it should be that by default anyway.
- Provide the link to the testpage.php.
Member
From: Wilmington, N.C.
Registered: 2006-04-05
Posts: 14
I've been thanked 0 times.
Offline
so is this code compatible with rss 2.0 feeds? On my site I have had no problem retrieving feeds but a couple of them have the titles and content mixed up..you can view my sample feed here: http://eltaito.com/news.php ...you can see that the newsvine feed is fine but the Wired.com and BBC News feeds are messed up. I know next to nothing about PHP and RSS so I'm not sure if its something stupid I'm doing or just that these are different versions of RSS and just not compatible (or require code adjustments). Anybody have any suggestions before I dive in and alter the PHP with reckless abandon
?
Its a funny time to learn to swim when you start to drown.
OK, I need to get this script working on Dreamhost, which disabled the PHP option allow_url_fopen. So it doesn't like the following line:
Code:
$rss_feed = file_get_contents($rss_url);
It needs to be turned into a cURL command, like something similar to this:
Code:
<?php
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://example.com');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
// display file
echo $file_contents;
?>
More information here: http://wiki.dreamhost.com/index.php/CURL
Just need a PHP guru to spend 30 seconds helping me out, because I just do not know how to do it. Huge thanks in advance.
Member
From: Fort Worth, TX
Registered: 2006-04-05
Posts: 15
I've been thanked 0 times.
Offline
travelagent wrote:
Neo; I see you're in Ft. Worth -- that's a good thing, since I'm a Native Texan from Corpus Christi, and lived / worked in the "HEB" area while I was an Air Traffic Controller at Dallas International, and also a Sheriff's Officer with Tarrant County many moons ago.
![]()
I know where you're coming from, having started in COBOL; tried C and C++ (literally threw both books into the pool within the first week); went on to Basic; VisualBasic; and VisualFoxPro (what a very boring database program); finally ending up on the Info Highway team designing the HTML syntax.
I'll try PHP again soon, just because it's a mystery to me right now and, it's not my nature to give up so easily -- like I, and many other programmers I personally know have said, we have a very deep dislike for the script because the structure is too weird for us which leads to aggravation.
I know all those places. I have friends and family in the HEB area, my uncle is an Air Traffic Controller out at the Houston International Airport (that's a rough job), and I've got a friend who's a 911 dispatcher in Denton County now...he's aiming to be a police officer.
And that's a long background experience in programming you've got there. I wanted to do software, but I got used to the quick-results of calculator programming (it runs and you see it, or it crashes
) and became impatient while learning Java, and kept on with web design. These days I am nearing complete mobility with my computing, so most of my interaction with people and data is internet-bound and internet-driven. So I've been working on ways to stay connected and get better functionality from the internet, where I was once just trying to power-use my PC.
I'm glad to see that you've not given up on this though; with your experience in the work-arounds that you've used for C and C++, the same methods can be applied (and modified) to do great things with PHP if only take time to learn the language. ASP.net is better at scaling applications for multiple users on the internet, but PHP is a powerful tool in its own rite. Hopefully that explanation above will set things straight for you this time.
Member
From: Fort Worth, TX
Registered: 2006-04-05
Posts: 15
I've been thanked 0 times.
Offline
CageDecay...I'm no php guru, so I'm going to have to let Mutilated1 answer it...it's his code.
And eltaito, I don't know the compatiblity of, or difference between RSS 2.0 and 0.9, in relation to this script. What it looks like from the page, is that there is a For Loop that is starting with an id greater than the description id such that
title_id.0 = Entry 1 title
desc_id.0 =
title_id.1 = Entry 2 title
desc_id.1 = Entry 1 description
title_id.2 = Entry 3 title
desc_id.2 = Entry 2 description
I don't have the code in front of me (because I'm at work), and I don't know what to edit from his code to check for feed validation/version. You might consider calling different feeds, or using a different reader, or perhaps Mutilated1 will have some solutions for you.
Member
From: Wilmington, N.C.
Registered: 2006-04-05
Posts: 14
I've been thanked 0 times.
Offline
thanks Neo....thats pretty much what I've been looking at too......I'm just not sure where in the PHP the starting point is defined...i see this code:
Code:
for ($counter = 1; $counter <= $howmany; $counter++ )
so I figure this means it is searching for the first title/descrip/link and then going up in increments of 1 until it reaches the number I defined in the call defined in my html document.......I guess I wonder if there is a way that I can set the description starting point back one (its the descriptions that appear to be off)..but then if I did that wouldn't that mess up the newsvine feed?......maybe Mutilated1 will know......I have to say though that I love this code.....I like it a whole lot more than the Javascript methods I see out there...but I guess I'm getting off topic here....I'm going to keep blindly tinkering (its kinda fun).....I'll check back later to see if anybody has any ideas....
Its a funny time to learn to swim when you start to drown.
| Never |


