Wednesday 26 December 2012

Add News Feed in Web Page

 Write the below Javascript code in the source code of your web page :

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<
script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"type="text/javascript"></script><
style type="text/css">@import
url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");#feedControl {margin-top : 10px;margin-left: auto;margin-right: auto;width : 205px;font-size: 12px;color: #9CADD0;}
</style><
script type="text/javascript">function
load() {
var feed = "http://rss.cnn.com/rss/edition_world.rss";new GFdynamicFeedControl(feed, "feedControl");}
google.load(
"feeds", "1");google.setOnLoadCallback(load);
</script>

---The variable Feed conatins the site from where the news are fetched. We can give some other sites too such as :
1. var feed =”http://feeds.bbci.co.uk/news/world/rss.xml”;
2. var feed =”http://rss.cnn.com/rss/edition_world.rss”;
3. var feed =”http://feeds.reuters.com/Reuters/worldNews “;
Now where ever you need the news feed in your page just write the below code :


<div id="feedControl" align="left" dir="ltr">Loading...&nbsp; </div>


You can see the page with active news feeds along with the link :

No comments:

Post a Comment