News for hackers. Stuff that matters.
Re:World Cup results for hackers by dvirsky on Wednesday June 18, 2014 @10:23AM (#7910241)
If you want this to remain on some side terminal and update constantly, you can of course run "watch worldcup today". And I like that the command actually makes sense :)

On a side note, in Gnome terminal, the formatting characters appear as some unicode garbage.

Re:World Cup results for hackers by jerrysievert on Wednesday June 18, 2014 @10:32AM (#7910299)
not just gnome, iterm as well. it appears as if watch doesn't support terminal color escaping correctly.
Re:World Cup results for hackers by teraflop on Wednesday June 18, 2014 @11:16AM (#7910566)
"watch -c" fixes this.
Re:World Cup results for hackers by dvirsky on Wednesday June 18, 2014 @01:51PM (#7911510)
Thanks, this fixes some of the problems, but I'm still seeing some weird unicode square shapes (that appear when I'm not running in watch as well)
Re:World Cup results for hackers by jerrysievert on Wednesday June 18, 2014 @12:37PM (#7911037)
only if you're using bash, unfortunately. i know, i'm an outlier, but i've found fish to be quite useable.
Re:World Cup results for hackers by fatiherikli on Wednesday June 18, 2014 @11:05AM (#7910502)
I'll look this problem. Thanks for your report.
Re:World Cup results for hackers by abuzzooz on Wednesday June 18, 2014 @12:58PM (#7911160)
Great job. I have my own mongodb of the games/scores that I update manually (not in real time though).

I would love to see something automated like this for the major leagues (La Liga, BPL, Bundesliga, Serie A). I tried my hand at scraping the HTML of different sites, but found out that the main ones guard against that by changing their HTML periodically, so I gave up.

Side question: what does HN think in general about scraping data from HTML? There are websites that charge for live sports data, and scraping them seems borderline unethical.

Re:World Cup results for hackers by matt_morgan on Wednesday June 18, 2014 @01:05PM (#7911206)
In the US at least, facts can't be protected with copyright, and sports scores & statistics have been judged facts. So you would be OK, and ethical. But avoid scraping/re-sharing anything of added value, like commentary or analysis.

I suspect rules in other countries vary.

Re:World Cup results for hackers by llamataboot on Wednesday June 18, 2014 @10:25AM (#7910253)
Thanks for using the http://worldcup.sfg.io API and making something cool! From one tinkerer to another, I salute you :)
Re:World Cup results for hackers by fatiherikli on Wednesday June 18, 2014 @11:03AM (#7910483)
Good to see your comment here :) I was very excited when I saw your project and blog post. Many thanks for this great job.
Re:World Cup results for hackers by girmad on Wednesday June 18, 2014 @11:53AM (#7910790)
The API looks great! Is there any way to include yellow & red cards, as well as timestamps for these events?
Re:World Cup results for hackers by llamataboot on Wednesday June 18, 2014 @12:56PM (#7911139)
I am looking at including more information right now, but I welcome pull requests of course! When I built it it was just a quick and dirty API for goals and standings, but it can obv include more information. There is an "official" FIFA API that includes all that info, but the legality of building your own app with it is unclear to me, and it seems largely undocumented.

http://live.mobileapp.fifa.com/api/wc/matches

Re:World Cup results for hackers by gry on Wednesday June 18, 2014 @02:29PM (#7911760)
The ToS in section 5.10 seems to address it:

http://www.fifa.com/legal/tos.html

  5.10 If You wish to use or display any FIFA feeds / FIFA APIs on Your website:

  (a) FIFA grants to You a non-transferable, royalty free, non-exclusive license to
  display such feeds on Your website subject to these Terms;
  
  (b) You expressly agree: (i) to ensure that the FIFA feed / FIFA API does not
  state or imply that FIFA approves of, sponsors or endorses any other website 
  activity, company or entity, resource, content, or presents FIFA and/or its 
  activities in a false, misleading, defamatory or derogatory manner or otherwise 
  damages FIFA's reputation or takes advantage of it; and (ii) to properly attribute
  the FIFA feeds used to FIFA to avoid any misappropriation or confusion;
  
  (c) where possible, You must create a functional link back to the FIFA story or
  other material summarized by the relevant FIFA feed.
Re:World Cup results for hackers by llamataboot on Wednesday June 18, 2014 @08:43PM (#7913800)
New branch pushed that includes cards and goals and subs, not live yet though - RABL output needs a little work, and while I'm grabbing the player, I haven't been able to grab the timestamp yet. Feel free to check it out.
Re:World Cup results for hackers by dmoo on Wednesday June 18, 2014 @12:11PM (#7910890)
Another thanks, I will have kids at my local coderdojo using the api tonight!
Re:World Cup results for hackers by mixologic on Wednesday June 18, 2014 @12:23PM (#7910947)
How come mine is an hour off? I just ran it and it says that Australia/Netherlands will be in 38 minutes?
Re:World Cup results for hackers by bshimmin on Wednesday June 18, 2014 @12:48PM (#7911095)
Re:World Cup results for hackers by matt_morgan on Wednesday June 18, 2014 @02:27PM (#7911746)
I bet this has something to do with it:

https://en.wikipedia.org/wiki/Daylight_saving_time_in_Brazil

Basically, some parts of Brazil, including the location (Porto Alegre) of the Australia-Netherlands game, use daylight time while others do not. It looks like, for example, the time of Spain-Chile (in Rio, where there is no daylight time) is correct.

Re:World Cup results for hackers by owenversteeg on Wednesday June 18, 2014 @01:15PM (#7911273)
Yep, mine is off as well. It says Australia/Netherlands is 15 minutes in (right now it's 57 minutes in)
Re:World Cup results for hackers by llamataboot on Wednesday June 18, 2014 @08:44PM (#7913803)
Yes, matches in Brazil take place in two separate time zones, We need to check the location and fix.
Re:World Cup results for hackers by matt_morgan on Wednesday June 18, 2014 @01:00PM (#7911166)
Maybe a TZ issue in there somewhere? Australia-Netherlands is still saying "Will be played after 29 seconds from now" with the score at 1-1. I'm in EDT, btw. I bet Brazil does not use daylight time?
Re:World Cup results for hackers by anuragbiyani on Wednesday June 18, 2014 @02:04PM (#7911596)
Crossposting from: https://news.ycombinator.com/item?id=7908081.

A small bash script to display the current match scores as part of the terminal prompt: https://gist.github.com/abiyani/34f25dc8ed2a862517e7

Sample output:

  abiyani@vaio:~ [BEL-2-1-ALG, RUS-1-1-KOR, BRA-0-0-MEX]
Re:World Cup results for hackers by scope on Wednesday June 18, 2014 @10:16AM (#7910193)
am gonna try n' steal your thunder, it's not as fancy as yours but me and a couple of friends created a league

http://moeduffdude.github.io/PIFA

I feed it the JSON and it does the calculations automatically - it's nice I get to have a 30 day streak :)

go Germany!

Re:World Cup results for hackers by 0003 on Wednesday June 18, 2014 @09:54AM (#7910060)
How come you switch between % operator and str.format method when string formatting?
Re:World Cup results for hackers by fatiherikli on Wednesday June 18, 2014 @11:09AM (#7910521)
I used that for text alignment functionalities.

https://docs.python.org/2/library/string.html#format-example...

Re:World Cup results for hackers by criswell on Wednesday June 18, 2014 @09:13AM (#7909848)
This would be pretty cool for sports in general. I wonder what the demand is like.
Re:World Cup results for hackers by hpoydar on Wednesday June 18, 2014 @05:07PM (#7912854)
Re:World Cup results for hackers by poseid on Wednesday June 18, 2014 @09:08AM (#7909815)
nice! I was playing with a similar setup in JavaScript and ArangoDB some days ago: http://thinkingonthinking.com/commonjs-for-databases/
Re:World Cup results for hackers by matt_morgan on Wednesday June 18, 2014 @11:26AM (#7910632)
THANK YOU! Fifa is doing such a crappy job online. This is perfect.
Re:World Cup results for hackers by petepete on Wednesday June 18, 2014 @11:31AM (#7910671)
Fifa, doing a crappy job? I refuse to believe it!
Re:World Cup results for hackers by deathwithme on Wednesday June 18, 2014 @09:01AM (#7909789)
great app for fans who like football and hacker things at the same time :)
Re:World Cup results for hackers by thromba on Wednesday June 18, 2014 @09:12AM (#7909840)
awwwwwesome.
Re:World Cup results for hackers by nebulous1 on Wednesday June 18, 2014 @09:22AM (#7909897)
This was actually posted already: https://news.ycombinator.com/item?id=7907070
Re:World Cup results for hackers by fatiherikli on Wednesday June 18, 2014 @09:27AM (#7909914)
Not the same thing.
Re:World Cup results for hackers by nebulous1 on Wednesday June 18, 2014 @10:40AM (#7910342)
oh, yeah!