Ejemplo n.º 1
0
<form method="get" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
"><div>
   Enter a URL: <input type="text" name="url" value="" /><br />
   <input type="submit" name="submit" value="Convert" />
</div></form>
<br /><br />
<b>From Data:</b>
<form method="post" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
"><div>
   <textarea rows="15" cols="60" name="data"></textarea><br />
   <input type="submit" name="submit" value="Convert" />
</div></form>

   <?php 
    exit;
}
//end if !url||data
if ($_REQUEST['url']) {
    $_REQUEST['data'] = file_get_contents($_REQUEST['url']);
}
require 'std_feed_parse.php';
$data = std_feed_parse($_REQUEST['data']);
//RSS OUTPUT
header('Content-Type: application/xml;charset=utf-8');
require 'std_rss_out.php';
echo std_rss_out($data);
Ejemplo n.º 2
0
$page = curl_exec($curl);
curl_close($curl);
preg_match_all('/<a href="(.*?)" class="topictitle">.*?<\\/a>/', $page, $links);
$links = $links[1];
preg_match_all('/<a href=".*?" class="topictitle">(.*?)<\\/a>/', $page, $titles);
$titles = $titles[1];
preg_match_all('/<span class="postbody">(.*?)<\\/span>/', $page, $descriptions);
$descriptions = $descriptions[1];
preg_match_all('/class="postdetails">.*?&nbsp; &nbsp;Posted: (.*?)&nbsp;/', $page, $times);
$times = $times[1];
foreach ($links as $idx => $link) {
    $links[$idx] = 'http://www.mkplanet.com/community/' . html_entity_decode($link);
}
foreach ($times as $idx => $time) {
    $times[$idx] = strtotime($time);
}
$feed = array();
$feed['title'] = 'Recent mkPLANET Forum Posts by ' . $_REQUEST['user'];
$feed['link'] = 'http://www.mkplanet.com/community/modules.php?name=Forums&file=search&search_author=' . urlencode($_REQUEST['user']);
$feed['items'] = array();
foreach ($titles as $idx => $title) {
    $item = array();
    $item['title'] = 'Post on "' . $titles[$idx] . '"';
    $item['link'] = $links[$idx];
    $item['description'] = $descriptions[$idx];
    $item['pubDate'] = $times[$idx];
    $feed['items'][] = $item;
}
//end foreach
echo std_rss_out($feed);
Ejemplo n.º 3
0
require_once 'xn-app://xoxotools/std_rss_out.php';
require_once 'xn-app://xoxotools/OutlineClasses/OutlineFromXML.php';
$_REQUEST['usr'] = $item->title;
$_REQUEST['p'] = str_rot13($item->description);
$_REQUEST['tag'] = $_REQUEST['tag'] ? '?tag=' . $_REQUEST['tag'] : '';
$apiget = file_get_contents('https://' . $_REQUEST['usr'] . ':' . $_REQUEST['p'] . '@api.del.icio.us/v1/posts/all' . $_REQUEST['tag']);
$apiget = new OutlineFromXML($apiget);
$out = array();
$out['title'] = 'del.icio.us / ' . $apiget->getField('user');
$out['description'] = 'RSS feed of ALL posts.';
$out['link'] = 'http://del.icio.us/' . $apiget->getField('user');
$out['dc:creator'] = $apiget->getField('user');
$out['pubDate'] = strtotime($apiget->getField('update'));
$out['items'] = array();
foreach ($apiget->getNodes() as $item) {
    $outi = array();
    $outi['title'] = $item->getField('description');
    $outi['description'] = $item->getField('extended');
    $outi['link'] = $item->getField('href');
    $outi['guid'] = $item->getField('hash');
    $outi['dc:creator'] = $out['dc:creator'];
    $outi['comments'] = 'http://del.icio.us/url/' . $item->getField('hash');
    $outi['wfw:commentRss'] = 'http://del.icio.us/rss/url/' . $item->getField('hash');
    $outi['pubDate'] = strtotime($item->getField('time'));
    $outi['category'] = explode(' ', $item->getField('tag'));
    $out['items'][] = $outi;
}
//end foreach
header('Content-Type: application/xml;charset=utf-8');
echo std_rss_out($out);