Permalink
Browse files

support rss/atom

  • Loading branch information...
1 parent e374782 commit 2235dfc5f217099a319f84a0fc5d34c584588b1d @airportyh committed Jun 7, 2010
Showing with 11 additions and 8 deletions.
  1. +1 −1 feeds.js
  2. +10 −7 wordyclouds.js
View
2 feeds.js
@@ -1,5 +1,5 @@
function loadFeed(){
- var url = 'http://tobyho.com/user/airportyh/rss.xml'
+ var url = 'http://tobyho.com'
var numEntries = 10
WordyClouds.loadFromFeed(url, numEntries)
}
View
17 wordyclouds.js
@@ -254,14 +254,17 @@ WordyClouds.loadFromDelicious = function(username){
WordyClouds.loadFromFeed = function(url, numEntries){
numEntries = numEntries || 10
var rand = new Date().getTime()
- JSONP.get('http://www.google.com/uds/Gfeeds?context=1&num=' + numEntries + '&hl=en&output=json&q=' + url + '&v=1.0&nocache=' + rand, function(v, data){
- var entries = data.feed.entries
- var text = ''
- entries.forEach(function(entry){
- text += entry.title + '\n'
- text += stripHTML(entry.content) + '\n'
+ JSONP.get('http://www.google.com/uds/GlookupFeed?context=0&hl=en&q=' + encodeURI(url) + '&v=1.0&nocache=' + rand, function(v, data){
+ rand = new Date().getTime()
+ JSONP.get('http://www.google.com/uds/Gfeeds?context=1&num=' + numEntries + '&hl=en&output=json&q=' + encodeURI(data.url) + '&v=1.0&nocache=' + rand, function(v, data){
+ var entries = data.feed.entries
+ var text = ''
+ entries.forEach(function(entry){
+ text += entry.title + '\n'
+ text += stripHTML(entry.content) + '\n'
+ })
+ WordyClouds.loadFromText(text)
})
- WordyClouds.loadFromText(text)
})
}
WordyClouds.runBookmarklet = function(){

0 comments on commit 2235dfc

Please sign in to comment.