Difference between revisions of "Widget:Feed"

From COPTR
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>__NOTOC__
 
<noinclude>__NOTOC__
  
This widget allows you to embed '''RSS with Netvibes''' on your wiki page.
 
  
  
Created by [http://www.mediawikiwidgets.org/User:lamidesbetes lamidesbetes]
+
</noinclude><includeonly><script type="text/javascript" src="https://www.google.com/jsapi"></script>
 
 
 
 
== Using this widget ==
 
 
 
For information on how to use this widget, see [http://www.mediawikiwidgets.org/Netvibes widget description page on MediaWikiWidgets.org].
 
 
 
 
 
== Copy to your site ==
 
 
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
 
 
</noinclude><includeonly><script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=BlogWidget2"></script>
 
 
 
 
<script type="text/javascript">
 
<script type="text/javascript">
  
var BW = new UWA.BlogWidget({moduleUrl:'http://www.netvibes.com/modules/feedReader/feedReader.php?feedUrl=<!--{$url|escape:'url'}-->&feedTitle=Nouse'});
+
    google.load("feeds", "1");
  
BW.setPreferencesValues({'view':'Magazine', 'nbTitles':'<!--{$number|default:'10'}-->', 'details':<!--{$details|default:'true'}-->, 'openOutside':<!--{$openoutside|default:'true'}-->});
+
    function initialize() {
 
+
      var feed = new google.feeds.Feed("<!--{$url}-->");
BW.setConfiguration({'title':'<!--{$title|default:'No title'}-->', 'height':<!--{$height|default:'200'}-->, 'color':'<!--{$color|default:'blue'}-->'});
+
      feed.load(function(result) {
 +
        if (!result.error) {
 +
          var container = document.getElementById("feed-{$url|escape:'url'}");
 +
          for (var i = 0; i < result.feed.entries.length; i++) {
 +
            var entry = result.feed.entries[i];
 +
            var div = document.createElement("div");
 +
            div.appendChild(document.createTextNode(entry.title));
 +
            container.appendChild(div);
 +
          }
 +
        }
 +
      });
 +
    }
 +
    google.setOnLoadCallback(initialize);
  
 
</script>
 
</script>
 
+
<div id="feed-{$url|escape:'url'}"></div>
 +
URL <!--{$url|escape:'url'}-->
 
</includeonly>
 
</includeonly>

Latest revision as of 20:11, 12 November 2013