سوالف اندرويد




العودة   سوالف سوفت > سوالف برمجة المواقع وتطويرها > PHP
التسجيل المدوّنات البحث مشاركات اليوم جعل الأقسام مقروءة

الرد على الموضوع
 
LinkBack أدوات الموضوع
عضو فعال
#1  
[طلب] كود بسيط: لعرض rss feeds

السلام عليكم ورحمة الله وبركاته ..

أحتاج كود بأي لغة javascript/php/html أو أيًا كانت تكون ..

فقط لعرض قائمة بآخر المواضيع من صفحة rss feed

مثلًا أضع رابط التغذية الخاص بمنتداي external.php?type=rss2

ويتم عرض آخر المدخلات بهذه الصفحة على شكل قائمة

يمكن وضعها في سكربت عادي

مثال :



أرجو أن يكون الكود مرن وقابل للتعديل مثلًا لتحديد عدد المواضيع المعروضة .. وأن يقبل أي صفحة تغذية سواءً كانت لسكربت منتدى أو غيره..

و أرجو أن يكون طلبي واضحًا ..

للعلم جربت كلاس اسمه lastRSS 0.9.1

لكن النتيجة كانت دائمًا : Error: It's not possible to reach RSS file...







آخر تعديل بواسطة Abdulrahman Hassoun في 01-12-2011 الساعة 03:43 PM.
Abdulrahman Hassoun is online now   قديم 01-12-2011, 03:40 PM
الرد مع إقتباس
عضو فعال جدا
#2  

استخدم الكلاس rssreader
للتحميل: http://apptools.com/phptools/downloads/rssreader.zip

مثال:
كود PHP:
<?php
   
// Include the file that does all the work
   
include("rssreader.php");

   
// This is the URL to the actual RSS feed. Change this value
   // if you want to show a different feed.
   
$url="http://news.yahoo.com/rss/";

   
// Create an instance of the rssFeed object, passing it
   // the URL of the feed
   
$rss=new rssFeed($url);

   
// If there was an error getting the data
   
if($rss->error){
      
// Show the error
      
print "<h1>Error:</h1>\n<p><strong>$rss->error</strong></p>";
   }else{

      
// Otherwise, we have the data, so we call the parse method
      
$rss->parse();

      
// The showHeading can accept a paramater that will be used
      // as the tag to wrap the heading. In this case, we're wrapping
      // the title in an <h1> tag
      
$rss->showHeading("h1");

      
// Display the image if there is one
      
$rss->showImage("left");
      
      
$rss->maxstories=10;

      
// If the RSS feed provides a link
      
if($rss->link){
         
// Display it
         
print "<p>Provided courtesy of:<br>\n";
         
$rss->showLink();
      }

      
// Display the description
      
$rss->showDescription();

      
// Show the news stories
      
$rss->showStories();
   }
?>
كما يمكنك التحكم في عدد العناوين المعروضة عن طريق تغيير القيمة هنا:
كود PHP:

      $rss
->maxstories=10






محمود حسين is offline   قديم 01-12-2011, 06:12 PM
الرد مع إقتباس
عضو فعال
#3  

إقتباس:
المشاركة الأصلية بواسطة محمود حسين مشاهدة مشاركة
استخدم الكلاس rssreader
للتحميل: http://apptools.com/phptools/downloads/rssreader.zip

مثال:
كود PHP:
<?php
   
// Include the file that does all the work
   
include("rssreader.php");

   
// This is the URL to the actual RSS feed. Change this value
   // if you want to show a different feed.
   
$url="http://news.yahoo.com/rss/";

   
// Create an instance of the rssFeed object, passing it
   // the URL of the feed
   
$rss=new rssFeed($url);

   
// If there was an error getting the data
   
if($rss->error){
      
// Show the error
      
print "<h1>Error:</h1>\n<p><strong>$rss->error</strong></p>";
   }else{

      
// Otherwise, we have the data, so we call the parse method
      
$rss->parse();

      
// The showHeading can accept a paramater that will be used
      // as the tag to wrap the heading. In this case, we're wrapping
      // the title in an <h1> tag
      
$rss->showHeading("h1");

      
// Display the image if there is one
      
$rss->showImage("left");
      
      
$rss->maxstories=10;

      
// If the RSS feed provides a link
      
if($rss->link){
         
// Display it
         
print "<p>Provided courtesy of:<br>\n";
         
$rss->showLink();
      }

      
// Display the description
      
$rss->showDescription();

      
// Show the news stories
      
$rss->showStories();
   }
?>
كما يمكنك التحكم في عدد العناوين المعروضة عن طريق تغيير القيمة هنا:
كود PHP:

      $rss
->maxstories=10
تمااااام ..

جربته.. وهو المطلوب تمامًا .. ويعمل بكفاائة

لكني لاحظت إن الكود مكتوب من 2005 يمكن يكون له تحديثات أو تحسينات؟

وجزاك الله كل خير على الكلاس ^^






Abdulrahman Hassoun is online now   قديم 02-12-2011, 07:17 PM
الرد مع إقتباس
الرد على الموضوع



أدوات الموضوع

قوانين المشاركات
لا يمكنك كتابة مواضيع جديدة
لا يمكنك إضافة ردود
لا يمكنك إرسال مرفقات
لا يمكنك تعديل مشاركاتك

كود vB متاح
كود [IMG] متاح
كود HTML غير متاح
Trackbacks are متاح
Pingbacks are متاح
Refbacks are متاح


المواضيع المشابهه
الموضوع كاتب الموضوع القسم الردود آخر مشاركة
جوجل ادسنس .. شى هام جدا خاص بال forward and feeds mr.chico الربح من خلال برنامج Google Adsense 0 21-02-2009 04:12 AM
محتاج سكريبت بسيط جدا لعرض الصور - عاجل Tender_Heart الويب والويب 2.0 والـ Semantic Web 0 21-05-2008 06:38 AM
برنامج بسيط لعرض بنرات بشكل عشوائي مجاناً من المركز العربي للبرمجة والتصميم sitepoint الويب والويب 2.0 والـ Semantic Web 0 31-01-2007 12:32 AM
تفضلوا كتاب Developing Feeds with RSS and Atom مدمن أنترنت الويب والويب 2.0 والـ Semantic Web 6 22-08-2005 12:23 PM
سكريبت بسيط لعرض الاعلانات فى موقعك **بالشرح** KaRiM_NET الويب والويب 2.0 والـ Semantic Web 0 03-01-2003 03:04 AM


جميع الأوقات بتوقيت غرينتش +3. الوقت الآن هو 10:19 PM.