lib/jkl.rb in jakal-0.1.94 vs lib/jkl.rb in jakal-0.1.95
- old
+ new
@@ -14,25 +14,19 @@
links.each do |link|
yield link if block_given?
end
end
- def topix_links(keyphrase)
- url = YAML::load_file('config/config.yml')['topix'] ||
- "http://www.topix.net/rss/search/article?q="
+ def topix_links(keyphrase, url = "http://www.topix.net/rss/search/article?q=")
links("#{url}#{keyphrase}")
- rescue Errno::ENOENT
end
def tags(key, link)
text = Jkl::Text::sanitize(Jkl::get_from(link))
Jkl::Extraction::tags(key, text)
end
- def trends
- url = YAML::load_file('config/config.yml')['twitter'] ||
- "http://search.twitter.com/trends.json"
+ def trends(url = "http://search.twitter.com/trends.json")
JSON.parse(Jkl::get_from(url))["trends"].map{|t| t["name"]}
- rescue Errno::ENOENT
end
end
end