Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updates to reduce number of feeds

  • Loading branch information...
commit 0440676e42ff5eb81e9f948bbfa3c369a0589961 1 parent d83760d
@martharotter authored
Showing with 60 additions and 25 deletions.
  1. +52 −0 RSSReader.php
  2. +8 −25 getrss.php
View
52 RSSReader.php
@@ -0,0 +1,52 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+<script type="text/javascript">
+function showRSS(str)
+{
+if (str.length==0)
+ {
+ document.getElementById("rssOutput").innerHTML="";
+ return;
+ }
+if (window.XMLHttpRequest)
+ {// code for IE7+, Firefox, Chrome, Opera, Safari
+ xmlhttp=new XMLHttpRequest();
+ }
+else
+ {// code for IE6, IE5
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+xmlhttp.onreadystatechange=function()
+ {
+ if (xmlhttp.readyState==4 && xmlhttp.status==200)
+ {
+ document.getElementById("rssOutput").innerHTML=xmlhttp.responseText;
+ }
+ }
+xmlhttp.open("GET","getrss.php?q="+str,true);
+xmlhttp.send();
+}
+</script>
+<title>Orchesta Hosted Sample RSS Reader</title>
+</head>
+
+<body>
+<h1>Orchestra-Hosted Sample RSS Reader</h1>
+
+<form>
+<select onchange="showRSS(this.value)">
+<option value="">Select an RSS-feed:</option>
+<option value="TeamworkPM">TeamworkPM</option>
+<option value="OnePageCRM">OnePageCRM</option>
+<option value="Allmoto">Allmoto</option>
+<option value="Intercom">Intercom</option>
+</select>
+</form>
+
+<br />
+<h2>Check out their RSS feed here: </h2>
+<div id="rssOutput"></div>
+</body>
+</html>
View
33 getrss.php
@@ -3,39 +3,22 @@
$q=$_GET["q"];
//find out which feed was selected
-if($q=="Orchestra")
+if($q=="TeamworkPM")
{
- $xml=("http://blog.orchestra.io/rss");
- }
-elseif($q=="Intercom")
- {
- $xml=("http://feeds.feedburner.com/contrast/blog?format=xml");
- }
-elseif($q=="Vigill")
- {
- $xml=("http://vigill.tumblr.com/rss");
- }
-elseif($q=="Lokofoto")
- {
- $xml=("http://blog.lokofoto.com/rss");
+ $xml=("http://engineroom.teamworkpm.net/rss.xml");
}
-elseif($q=="Exordo")
+elseif($q=="OnePageCRM")
{
- $xml=("http://blog.exordo.com/feed/");
+ $xml=("http://www.onepagecrm.com/happy-selling-blog/feed/rss/");
}
elseif($q=="Allmoto")
{
$xml=("http://www.allmoto-online.com/site/blog/feed/rss/");
}
-elseif($q=="OnePageCRM")
- {
- $xml=("http://www.onepagecrm.com/happy-selling-blog/feed/rss/");
- }
-elseif($q=="TeamworkPM")
+elseif($q=="Intercom")
{
- $xml=("http://engineroom.teamworkpm.net/rss.xml");
+ $xml=("http://feeds.feedburner.com/contrast/blog?format=xml");
}
-
$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);
@@ -44,8 +27,8 @@
$channel=$xmlDoc->getElementsByTagName('channel')->item(0);
$channel_title = $channel->getElementsByTagName('title')
->item(0)->childNodes->item(0)->nodeValue;
-// $channel_link = $channel->getElementsByTagName('link')
-// ->item(0)->childNodes->item(0)->nodeValue;
+$channel_link = $channel->getElementsByTagName('link')
+ ->item(0)->childNodes->item(0)->nodeValue;
$channel_desc = $channel->getElementsByTagName('description')
->item(0)->childNodes->item(0)->nodeValue;
Please sign in to comment.
Something went wrong with that request. Please try again.