Ansa Library for Ruby
Read news from Ansa đ
Install
Add to your Gemfile
gem 'ansa'
Usage
Import using
require 'ansa'
Get all the news about soccer
news = Ansa::get_soccer_news()
puts news[0].title
You can also use get_news
method, specifying the category you want
news = Ansa::get_news(Ansa::SOCCER)
For more methods see the documentation.
Example
require 'ansa'
puts "\nâ˝ď¸ SOCCER NEWS â˝ď¸\n\n"
begin
Ansa::get_soccer_news.each do |news|
puts "đĽ
[#{news.date.strftime("%d/%m %H:%M:%S")}] #{news.title}"
puts news.description
puts "\n"
end
rescue Ansa::AnsaError
puts "đ¨ Something went wrong, news not available"
end