[New forum] Getting this done
Moderator: Staff
Re: [New forum] Getting this done
As long as people that aren't me are willing to tirelessly do the work, sure.
- dr-spangle
- Technical Advisor
- Posts: 13072
- Joined: Wed May 30, 2007 12:20 pm
- Contact:
Re: [New forum] Getting this done
pawelabrams wrote:well, give me the code you use, and I could do this - but considering the debate on whether we should be a hub for MicroWiki nations as well, I'd rather have only MicrasWiki there.
Code: Select all
<h1><a href="http://microwiki.co.cc" class="title">MicroWiki</a> updates</h1>
<ul>
<?
$xml = simplexml_load_file("inc_feed_wiki.txt");
$show = 20;
for($a=0;$a<$show;$a++) {
$date = gmdate('jS F',strtotime($xml->channel->item[$a]->pubDate));
if(($a/2)==floor($a/2)) {
echo('<li class="b1"><b>'.$date.' - <a href="'.$xml->channel->item[$a]->link.'">'.$xml->channel->item[$a]->title.'</a></b></li>
');
} else {
echo('<li class="b2">'.$date.' - <a href="'.$xml->channel->item[$a]->link.'">'.$xml->channel->item[$a]->title.'</a></li>
');
}}
?>
</ul>
Code: Select all
<?
//Update wiki
$feed_wiki = file_get_contents("http://microwiki.co.cc/index.php?title=Special:RecentChanges&feed=rss");
if($feed_wiki!=FALSE) {
$file_wiki = fopen("inc_feed_wiki.txt","w+");
echo fwrite($file_wiki,$feed_wiki);
fclose($file_wiki);
} else {
echo('FUUUUUUUUU WIKI FEED NOT WORKING.');
}
//Update news
$feed_news = file_get_contents("http://www.xfruits.com/micronations/?id=67998");
if($feed_news!=FALSE) {
$file_news = fopen("inc_feed_news.txt","w+");
echo fwrite($file_news,$feed_news);
fclose($file_news);
} else {
echo('FUUUUUUUUU NEWS FEED NOT WORKING.');
}
?>
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: [New forum] Getting this done
The part of the update.php is obvious:
I'm working on the front-end part now. And what am I thinking about now is whether we shouldn't optimize the code - serialize the RSS data rather than parsing it every time we send it to the viewer.
EDIT: I'm also considering splitting this thread and moving hub.mn discussion into Website Administration board.
Code: Select all
//Update wikis
$feed_microWiki = file_get_contents("http://microwiki.co.cc/index.php?title=Special:RecentChanges&feed=rss");
if($feed_microWiki!=FALSE) {
$file_wiki = fopen("inc_feed_microwiki.txt","w+");
echo fwrite($file_wiki,$feed_wiki);
fclose($file_wiki);
} else {
echo('FUUUUUUUUU MICROWIKI FEED NOT WORKING.');
}
$feed_micrasWiki = file_get_contents("http://micras.org/wiki/index.php?title=Special:RecentChanges&feed=rss");
if($feed_micrasWiki!=FALSE) {
$file_wiki = fopen("inc_feed_micraswiki.txt","w+");
echo fwrite($file_wiki,$feed_wiki);
fclose($file_wiki);
} else {
echo('FUUUUUUUUU MICRASWIKI FEED NOT WORKING.');
}
EDIT: I'm also considering splitting this thread and moving hub.mn discussion into Website Administration board.
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.
Re: [New forum] Getting this done
Still no progress on getting the MicrasWiki feed up?
Anything I can do to help?
Anything I can do to help?
- pawelabrams
- Posts: 3207
- Joined: Sun Jun 24, 2007 8:14 pm
- Location: Novograd, Interland
- Contact:
Re: [New forum] Getting this done
Code: Select all
$xmlMicro = simplexml_load_file("inc_feed_microwiki.txt");
$xmlMicras = simplexml_load_file("inc_feed_micraswiki.txt");
$show = 20;
for($a=0;$a<$show;$a++) {
$time = strtotime($xmlMicro->channel->item[$a]->pubDate);
$feed[$time]['micro'] = array('source' => 'micro', 'link' => $xmlMicro->channel->item[$a]->link, 'title' => $xmlMicro->channel->item[$a]->title);
}
for($a=0;$a<$show;$a++) {
$time = strtotime($xmlMicras->channel->item[$a]->pubDate);
$feed[$time]['micras'] = array('source' => 'micras', 'link' => $xmlMicras->channel->item[$a]->link, 'title' => $xmlMicras->channel->item[$a]->title);
}
krsort($feed);
reset($feed);
for($a=0;$a<$show;$a++) {
$current = current($array);
$date = gmdate('jS F', key($array));
if (isset($current['micro'])) {
if(!($a % 2))
echo '<li class="b1"><b>[MO]'.$date.' - <a href="'.$current['micro']['link'].'">'.$current['micro']['title']."</a></b></li>\r\n";
else
echo '<li class="b2">[MO]'.$date.' - <a href="'.$current['micro']['link'].'">'.$current['micro']['title']."</a></li>\r\n";
} else {
if(!($a % 2))
echo '<li class="b1"><b>[MS]'.$date.' - <a href="'.$current['micras']['link'].'">'.$current['micras']['title']."</a></b></li>\r\n";
else
echo '<li class="b2">[MS]'.$date.' - <a href="'.$current['micras']['link'].'">'.$current['micras']['title']."</a></li>\r\n";
}
next($feed);
}
Pavel' Abramovic:, the President of Interland
IRL just a random guy from Poland. Still learning English.
IRL just a random guy from Poland. Still learning English.