Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the community name to item.title #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions feed.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
error_reporting(E_ERROR);
include_once("mergedrss.php");

if ( ! empty($_GET["category"]) ) {
Expand All @@ -18,8 +19,8 @@
switch ($category) {
case "blog":
$feeds = array(
array('http://blog.freifunk.net/rss.xml','blog.freifunk.net','http://blog.freifunk.net'),
array('http://freifunkstattangst.de/feed/', 'freifunk statt Angst','http://freifunkstattangst.de'),
array('http://blog.freifunk.net/rss.xml','blog.freifunk.net','http://blog.freifunk.net'),
array('http://freifunkstattangst.de/feed/', 'freifunk statt Angst','http://freifunkstattangst.de'),
array('http://radio.freifunk-bno.de/freifunk_radio_feedfeed.xml', 'Freifunk Radio', 'http://wiki.freifunk.net/Freifunk.radio')
);
break;
Expand Down Expand Up @@ -58,4 +59,3 @@

//Export the first 10 items to screen
$MergedRSS->export(false, true, 50);

6 changes: 3 additions & 3 deletions mergedrss.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function export($return_as_string = true, $output = false, $limit = null)
// loop through each feed
foreach ($this->myFeeds as $feed_array) {
$feed_url = $feed_array[0];
$feed_title = trim($feed_array[1]);
// determine my cache file name. for now i assume they're all kept in a file called "cache"
$cache_file = "cache/" . $this->__create_feed_key($feed_url);

Expand Down Expand Up @@ -78,7 +79,7 @@ public function export($return_as_string = true, $output = false, $limit = null)
continue;
}
//convert title to utf-8 (i.e. from facebook feeds)
$item->title = html_entity_decode($item->title, ENT_QUOTES, 'UTF-8');
$item->title = '[' . $feed_title . '] ' . html_entity_decode($item->title, ENT_QUOTES, 'UTF-8');
$source = $item->addChild('source', '' . $feed_array[1]);
$source->addAttribute('url', $feed_array[2]);
$items[] = $item;
Expand Down Expand Up @@ -161,5 +162,4 @@ private function __create_feed_key($url) {
return preg_replace('/[^a-zA-Z0-9\.]/', '_', $url) . 'cache';
}

}

}