| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <sect1 id="zend.feed.introduction">
- <title>הקדמה</title>
- <para>
- <code>Zend_Feed</code> מספק פונקציונליות לצריכת סנדקציה של RSS ו Atom. היא מספקת תחביר טבעי לגישה לאלמנטים בתוך הסנדקציה, ערכי סנדקציה, וערכי ערכים מסויימים.
- <code>Zend_Feed</code> מאפשר תמיכה רחבה לעריכה של מבנה הסנדקציה והערכים עם אותו התחביר הטבעי, והמרת התוצאה בחזרה ל XML.
- </para>
- <para>
- טכנית, <code>Zend_Feed</code> מכיל מחלקת בסיס <code>Zend_Feed</code>, מחלקות לא מוחשיות <code>Zend_Feed_Abstract</code> ו <code>Zend_Feed_Entry_Abstract</code>
- אשר מייצגים סנדצקיות ורשומות, הטמעות ספצפיות לסנדצקיות של RSS ו Atom, ותוספי עזרה אשר עושים את העבודה מאחורי הקלעים.
- </para>
- <para>
- בדוגמא למטה, אנחנו מדגימים שימוש פשוט בקבלת סנדקצית RSS ושמירה של חלק ממנה אל מערך ב PHP, שלאחר מכן יהיה ניתן להדפיסו, שמירה במסד הנתונים וכדומה.
- </para>
- <note>
- <title>תהיו מודעים</title>
- <para>
- סנדצקיות רבות מכילות ערוצים שונים וערכים שונים. המפרט של RSS מספק הרבה ערכים אופציונלים, אז יש להיות מודעים על כך ברגע שכותבים קוד אשר יעבוד עם תוכן RSS.
- </para>
- </note>
- <example id="zend.feed.introduction.example.rss">
- <title>שימוש ב <code>Zend_Feed</code> על מידע מ RSS</title>
- <programlisting role="php"><![CDATA[
- // Fetch the latest Slashdot headlines
- try {
- $slashdotRss =
- Zend_Feed::import('http://rss.slashdot.org/Slashdot/slashdot');
- } catch (Zend_Feed_Exception $e) {
- // feed import failed
- echo "Exception caught importing feed: {$e->getMessage()}\n";
- exit;
- }
- // Initialize the channel data array
- $channel = array(
- 'title' => $slashdotRss->title(),
- 'link' => $slashdotRss->link(),
- 'description' => $slashdotRss->description(),
- 'items' => array()
- );
- // Loop over each channel item and store relevant data
- foreach ($slashdotRss as $item) {
- $channel['items'][] = array(
- 'title' => $item->title(),
- 'link' => $item->link(),
- 'description' => $item->description()
- );
- }
- ]]>
- </programlisting>
- </example>
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|