Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Using Php And Javascript To Manage Rss Feeds
demolaynyc
post Jan 21 2007, 02:51 AM
Post #1


Premium Member
Group Icon

Group: Members
Posts: 330
Joined: 2-February 06
Member No.: 11,040



This thread is not a real tutorial, but basically a brief method of manipulating RSS feeds using Javascript and PHP while avoiding the confusing parsing methods of EXPAT (which I find really annoying to learn, yet I still haven't finished learning it)

I know that many people are quite used to scripting in EXPAT to parse XML files, but to those who are not used to event-parsing method, I've come up with an alternative way. However, there are a few things you must know about Javascript and PHP/MySQL and XML.

For java script: XML DOM
For PHP/MySQL: Database to hold post
For XML: to make RSS feeds
So I just came up with this last night on the top of my head. This will be the first time I'm writing it down so bare with me.

Basically what you have to do is to parse the RSS feed using XML DOM. To create a new item for the RSS feed, you would insert a new row to the database using PHP and SQL. After that section of the PHP program, declare a variable that would hold the source code for the "updated RSS feed"

Example:

CODE

$rss = "<? xml version="1.0" ?> \n";
$rss .= " <? rss version="2.0" ?> \n";


Basically that's what you would have to do. Please excuse the errors that might exist inside those values. I haven't written an XML in a while so I forgot what it was supposed to be like.

Now after the opening tags, you would insert the 6 most recent rows in the MySQL database. I prefer using 6 because isn't that the standard? I don't know maybe 15 but it can be any amount you want. Just don't make the file too big.

After you've done this, overwrite or create a new RSS file. And there you go.
Go to the top of the page
 
+Quote Post

Fast ReplyReply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting Screen Resolution using Javascript.(8)
  2. How To Create A Popup Window With Javascript?(19)
  3. javascript vs java(12)
  4. Javascript: Disable Mouse Right-click In Browser(16)
  5. Random Images On Eacht Pageload And Refresh.(6)
  6. Creating Tooltips(7)
  7. Hack Websites(8)
  8. Best Way To Learn Javascript(9)
  9. Javascript: Text To Texbox And Back To Text(2)
  10. JavaScript: Hide And Show Any Element With CSS(5)
  11. Ever Needs To Find Out A Table Height Or With With JavaScript(2)
  12. Create And Import JavaScript Modules For A Large Script(2)
  13. JavaScript Frames & Querystring(4)
  14. I Need Help With Javascript.(7)
  15. Add Text To Textarea(6)
  1. Extplorer(7)
  2. Send Php Variable To Javascript(5)
  3. Include Function For Javascript(7)
  4. Fun With Javascript And Forms(2)
  5. Javascript Problem(3)
  6. Javascript Help Needed : Alert(z) Works Fine But Document.write Not(2)
  7. Javascript Xml Parser Vs. Xslt Processor(0)
  8. Javascript Changes Aren't Working.(6)
  9. Flashget Download Manage(0)
  10. Javascript Tutorial For Beginner(0)
  11. Javascript Operators(0)
  12. Conditional Statements Of Javascript(1)
  13. Web Editor(0)


 



- Lo-Fi Version Time is now: 29th August 2008 - 05:14 AM