SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | ||
3 | header("Content-type:text/javascript"); | |
4 | ||
5 | include('magpierss/rss_fetch.inc'); | |
6 | ||
7 | error_reporting(0); | |
8 | ||
9 | $url = "http://feeds.wired.com/wired/index"; | |
10 | $url1 = "http://feeds.feedburner.com/GoFindTheOthers"; | |
11 | $rss = fetch_rss($url); | |
12 | $rss1 = fetch_rss($url1); | |
13 | if ($rss) { | |
14 | ||
15 | $items = array_slice($rss->items, 0, 10); | |
16 | ||
17 | $news_string = ""; | |
18 | ||
19 | foreach ($items as $item) { | |
20 | ||
21 | $news_string = $news_string. "<p><a href='" | |
22 | ||
23 | .$item['link']. "'>" .$item['title']. | |
24 | ||
25 | "</a></p>"; | |
26 | ||
27 | } | |
28 | ||
29 | } | |
30 | if ($rss1) { | |
31 | ||
32 | $items = array_slice($rss1->items, 0, 10); | |
33 | ||
34 | $news_string1 = ""; | |
35 | ||
36 | foreach ($items as $item) { | |
37 | ||
38 | $news_string1 = $news_string1. "<p><a href='" | |
39 | ||
40 | .$item['link']. "'>" .$item['title']. | |
41 | ||
42 | "</a></p>"; | |
43 | ||
44 | } | |
45 | ||
46 | } | |
47 | ||
48 | ||
49 | - | echo "document.write('$news_string')"; |
49 | + | echo $news_string; |
50 | - | echo "document.write('$news_string1')"; |
50 | + | echo $news_string1; |
51 | @ini_restore('error_reporting'); | |
52 | ||
53 | ?> |