1

I'm trying to get RSS feeds from the Scotrail Journeycheck site using the RSS feed. I am getting a list OK, but it only shows the service that has delays without actual info, and will not extend as far as Departure and Arrival times as the Journeycheck page does. This for example shows Largs to Glasgow. I call the journey up on Journeycheck and copy the RSS link.

<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi?">
</script>

<script type="text/javascript">
google.load("feeds", "1") //Load Google Ajax Feed API (version 1)
</script>
</head>

<body>
<div id="feeddiv"></div>
</body>
</html>
<script type="text/javascript">

var feedcontainer=document.getElementById("feeddiv")
var feedurl="http://rss.journeycheck.com/scotrail/route?action=search&  from=LAR&to=GLC&period=today&formTubeUpdateLocation=&formTubeUpdatePeriod=&savedRoute="
var feedlimit=150
var rssoutput="<b>Scotrail Planner:</b><br /><ul>"

function rssfeedsetup(){
var feedpointer=new google.feeds.Feed(feedurl) //Google Feed API method
feedpointer.setNumEntries(feedlimit) //Google Feed API method
feedpointer.load(displayfeed) //Google Feed API method
}

function displayfeed(result){
if (!result.error){
var thefeeds=result.feed.entries
for (var i=0; i<thefeeds.length; i++)
rssoutput+="<li><a href='" + thefeeds[i].link + "'>" + thefeeds[i].title + "</a></li>"
rssoutput+="</ul>"
feedcontainer.innerHTML=rssoutput
}
else
alert("Error fetching feeds!")
}

window.onload=function(){
rssfeedsetup()
}

</script>
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.