Last change
on this file since 12 was
12,
checked in by basvannuland, 14 years ago
|
Added RAP RDF API
Added RDF reader writer for save and load survey
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | define('MAGPIE_DIR', '../');
|
---|
4 | require_once(MAGPIE_DIR.'rss_fetch.inc');
|
---|
5 |
|
---|
6 | $url = $_GET['rss_url'];
|
---|
7 |
|
---|
8 | ?>
|
---|
9 |
|
---|
10 | <html
|
---|
11 | <body LINK="#999999" VLINK="#000000">
|
---|
12 |
|
---|
13 | <form>
|
---|
14 | <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit">
|
---|
15 | </form>
|
---|
16 |
|
---|
17 | <?php
|
---|
18 |
|
---|
19 | if ( $url ) {
|
---|
20 | echo "displaying: $url<p>";
|
---|
21 | $rss = fetch_rss( $url );
|
---|
22 | echo slashbox ($rss);
|
---|
23 | }
|
---|
24 |
|
---|
25 | echo "<pre>";
|
---|
26 | print_r($rss);
|
---|
27 | echo "</pre>";
|
---|
28 | ?>
|
---|
29 |
|
---|
30 | </body>
|
---|
31 | </html>
|
---|
32 |
|
---|
33 | <?php
|
---|
34 |
|
---|
35 | # just some quick and ugly php to generate html
|
---|
36 | #
|
---|
37 | #
|
---|
38 | function slashbox ($rss) {
|
---|
39 | echo "<table cellpadding=2 cellspacing=0><tr>";
|
---|
40 | echo "<td bgcolor=#006666>";
|
---|
41 |
|
---|
42 | # get the channel title and link properties off of the rss object
|
---|
43 | #
|
---|
44 | $title = $rss->channel['title'];
|
---|
45 | $link = $rss->channel['link'];
|
---|
46 |
|
---|
47 | echo "<a href=$link><font color=#FFFFFF><b>$title</b></font></a>";
|
---|
48 | echo "</td></tr>";
|
---|
49 |
|
---|
50 | # foreach over each item in the array.
|
---|
51 | # displaying simple links
|
---|
52 | #
|
---|
53 | # we could be doing all sorts of neat things with the dublin core
|
---|
54 | # info, or the event info, or what not, but keeping it simple for now.
|
---|
55 | #
|
---|
56 | foreach ($rss->items as $item ) {
|
---|
57 | echo "<tr><td bgcolor=#cccccc>";
|
---|
58 | echo "<a href=$item[link]>";
|
---|
59 | echo $item['title'];
|
---|
60 | echo "</a></td></tr>";
|
---|
61 | }
|
---|
62 |
|
---|
63 | echo "</table>";
|
---|
64 | }
|
---|
65 |
|
---|
66 | ?>
|
---|
Note: See
TracBrowser
for help on using the repository browser.