Project

ansa

0.0
No commit activity in last 3 years
No release in over 3 years
Read all the news from http://www.ansa.it
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.1.10
>= 0
>= 0
 Project Readme

Ansa Library for Ruby

Read news from Ansa 🗞

Yard Docs Gem Version Build Status codecov

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