What could you do if you had access to the world’s news, and had a standardized and rational way to get quick responses to rich queries about what’s happening in the world? What could you build if you could incorporate dynamic, global, continually refreshed, high quality content into your applications, widgets, and websites? You should have many answers. But I have only 1 act, I will smileproudly. :D. Let's start to implement it by using Ruby on Rails:
- Get API Key HERE
- Download this code and paste it to your app_name/lib folder
- Then in your controller, put it :
require 'daylife'
a = Daylife::API.new('your api key','sharedsecret')
r = a.execute('search','getRelatedArticles', :query => 'sam adams', :limit => 5)
if(r.success?)
r.articles.each {|a| puts a.headline }
puts r.articles[1].source.daylife_url
else
# output the error message
puts "Error: #{r.code}: #{r.message}"
end
- Now your dream comes true to have site like Yahoo News or at least like daylife.com
- What else can you do with this dayAPI? Read More Here
- Has been tested and working nice :D
No Response to "Create Realtime World News in Your Site"
Post a Comment