Vous devez être membre et vous identifier pour publier un article.
Les visiteurs peuvent toutefois commenter chaque article par une réponse.
Réaliser un RSS depuis n'importe quelle page
Article publié le 26/04/2005 10:26:09Code php (67 lignes)
‹?php // Screen scraping your way into RSS // Example script, by Dennis Pallett // http://www.phpit.net/tutorials/screenscrap-rss // Get page $url = "http://www.phpit.net/"; // Get content items preg_match_all ("/‹div class=\"contentitem\"›([^`]*?)‹\/div›/", $data, $matches); // Begin feed echo "‹?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?›\n"; ?› ‹rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"› ‹channel› ‹title›PHPit Latest Content‹/title› ‹description›The latest content from PHPit (http://www.phpit.net), screen scraped!‹/description› ‹link›http://www.phpit.net‹/link› ‹language›en-us‹/language› ‹? // Loop through each content item foreach ($matches[0] as $match) { // First, get title $title = $temp['1']; // Second, get url $url = $temp['1']; // Third, get text $text = $temp['1']; // Fourth, and finally, get author $author = $temp['1']; // Echo RSS XML echo "‹item›\n"; echo "\t\t\t‹content:encoded›‹![CDATA[ \n"; echo $text . "\n"; echo " ]]›‹/content:encoded›\n"; echo "\t\t‹/item›\n"; } ?› ‹/channel› ‹/rss›
Un article de reboot
Source : www.phpit.net
Commentaires
09/05/2005 22:34:28
Sinon, il y a l'article de Snspy qui est plus facile pour afficher les RSS (il suffit d'installer le soft): cf ast237
- Lea72 -
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 13/09/2004, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/ast-rf-235.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.