8000 examples are broken due to Yahoo · Issue #670 · ruby-concurrency/concurrent-ruby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

examples are broken due to Yahoo #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xiaoronglv opened this issue Aug 18, 2017 · 13 comments
Closed

examples are broken due to Yahoo #670

xiaoronglv opened this issue Aug 18, 2017 · 13 comments
Assignees
Labels
chore Gem maintenance tasks. medium-priority Should be done soon.

Comments

@xiaoronglv
Copy link

Lots of examples are requesting yahoo finance, but this api is discontinued by Yahoo.

so the following examples doesn't work for newbies. Could you please replace yahoo?

Many thanks.

require 'concurrent'
require 'thread'   # for Queue
require 'open-uri' # for open(uri)

class Ticker
  def get_year_end_closing(symbol, year)

    uri = "http://ichart.finance.yahoo.com/table.csv?s=#{symbol}&a=11&b=01&c=#{year}&d=11&e=31&f=#{year}&g=m"
    puts uri
    data = open(uri) {|f| f.collect{|line| line.strip } }
    data[1].split(',')[4].to_f
  end
end

Reference

https://forums.yahoo.net/t5/Yahoo-Finance-help/Is-Yahoo-Finance-API-broken/td-p/250503

URI

http://ichart.finance.yahoo.com/table.csv?s=TWTR&a=11&b=01&c=2013&d=11&e=31&f=2013&g=m

@pitr-ch pitr-ch added chore Gem maintenance tasks. looking-for-contributor labels Nov 18, 2017
@pitr-ch
Copy link
Member
pitr-ch commented Nov 18, 2017

Thanks, we'll fix it.

@pitr-ch pitr-ch added this to the 1.1.0 milestone Nov 18, 2017
@GustavoCaso
Copy link
Contributor

I'm going to have a look at this one 😄

@pitr-ch
Copy link
Member
pitr-ch commented Nov 18, 2017

Thanks, @GustavoCaso!

@pitr-ch pitr-ch assigned pitr-ch and unassigned pitr-ch Nov 18, 2017
@pitr-ch pitr-ch added the minor label Jun 18, 2018
@pitr-ch pitr-ch added medium-priority Should be done soon. and removed minor labels Jun 29, 2018
@pitr-ch
Copy link
Member
pitr-ch commented Jul 6, 2018

@GustavoCaso are you still looking into this? If not please let me know.

@pitr-ch pitr-ch added the pending Waiting for response, blocked by other problem, etc. label Jul 6, 2018
@GustavoCaso
Copy link
Contributor

Hey @pitr-ch, first of all, thank you for the invite. Sorry for the huge delay swamp with work and other contributions. But count with me for this one

@pitr-ch
Copy link
Member
pitr-ch commented Jul 6, 2018

Ok great, I've assigned it to you.

@pitr-ch pitr-ch removed the pending Waiting for response, blocked by other problem, etc. label Jul 6, 2018
@GustavoCaso
Copy link
Contributor

Thanks

@pitr-ch pitr-ch removed this from the 1.1.0 milestone Jul 6, 2018
@GustavoCaso
Copy link
Contributor
GustavoCaso commented Jul 21, 2018

@pitr-ch I started working on fixing the examples but got stack when the example works only if I puts the row when parsing it.

Here is a gist with the example and a comment, any feedback is very welcome https://gist.github.com/GustavoCaso/862139e82718341db4cfb00ea8720f2e

@pitr-ch
Copy link
Member
pitr-ch commented Aug 2, 2018

Thanks for looking at it, sorry I missed your comment. The gist example works for me without puts added, how does it fail for you?

@GustavoCaso
Copy link
Contributor

@pitr-ch If I run it multiple times there is no output, maybe the first time it is, but later there is no output

@pitr-ch
Copy link
Member
pitr-ch commented Aug 15, 2018

@GustavoCaso try to call #value! instead of value it will give you an error happening in get_year_end_closing. The error is there even with the puts added. Btw the example does not need to use the same API you can do something with GitHub API or anything else if you like.

@pitr-ch
Copy link
Member
pitr-ch commented Aug 15, 2018

Just got to looking at your PR :)

@chrisseaton
Copy link
Member

Fixed in #937.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Gem maintenance tasks. medium-priority Should be done soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0