footballdb-clubs Gem / Library - Match 1500+ Football Club Names from 100+ Leagues from Around the World
Gerald Bauer <[email protected]> Sun, 18 Aug 2019 19:16:57 +0200
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <CAAxEZd9At1m_u2PaFUtDeD8UQssEtFra0mLmVsoKaempRdxF0w@mail.gmail.com> |
Hello, I've put together a new footballdb-clubs gem / library [1] that bundles-up an all-in-one football.db /clubs datafile [2] and lets you match 1500+ football club names from around the world "out-of-the-gem / box " with zero-configuration. It's as easy as: ``` ruby require 'footballdb/clubs' pp Club.all ``` resulting in: ``` [#<Club @name="Al Ahly", @city="Cairo", @country="Egypt", ...>, #<Club @name="Al Mokawloon Al Arab", @city="Cairo", @country="Egypt", ...>, #<Club @name="El Dakhleya", @city="Cairo", @country="Egypt", ...>, #<Club @name="El Entag El Harby", @city="Cairo", @country="Egypt", ...>, ... ] ``` What else is new? Let's match football club names to find the wikipedia page name and url (for the English edition): ``` ruby m = Club.match( 'Club Brugge KV' ) m[0].wikipedia #=> "Club Brugge KV" m[0].wikipedia_url #=> "https://en.wikipedia.org/wiki/Club_Brugge_KV" m = Club.match( 'RSC Anderlecht' ) m[0].wikipedia #=> "R.S.C. Anderlecht" m[0].wikipedia_url #=> "https://en.wikipedia.org/wiki/R.S.C._Anderlecht" # and so on # ... ``` Note: Find all football club wikipedia page names in the built-in copy bundled-up into a single clubs.wiki.txt datafile [3]. Enjoy the beautiful game. Cheers. Prost. [1] https://github.com/sportdb/sport.db/tree/master/footballdb-clubs [2] https://github.com/sportdb/sport.db/blob/master/footballdb-clubs/config/clubs.txt [3] https://github.com/sportdb/sport.db/blob/master/footballdb-clubs/config/clubs.wiki.txt Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>