publish feed price automatic(From BitSuperLab)

Started by alt, August 28, 2014, 02:18:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xeroc

you could also check with

$ python3
import statistics

alt

if you are running ubuntu1404, you can try to find the file and check if the package install correct


alt@localhost:~/workspace/bitsuperlab/btsfeed$ dpkg -S /usr/lib/python3.4/statistics.py
libpython3.4-stdlib:amd64: /usr/lib/python3.4/statistics.py


Quote from: monsterer on November 26, 2014, 11:12:27 PM
Quote from: monsterer on November 26, 2014, 11:17:49 AM
That's a bit disturbing, since I'm using python3 to run the command. My system does have an older python on the path, could it be finding some part of the original version, rather than the new one at run time?

Anyone got any advice? I'm kind of at a loss. I'd appreciate any suggestions because I'd like to provide feeds for my delegate.

monsterer

Quote from: monsterer on November 26, 2014, 11:17:49 AM
That's a bit disturbing, since I'm using python3 to run the command. My system does have an older python on the path, could it be finding some part of the original version, rather than the new one at run time?

Anyone got any advice? I'm kind of at a loss. I'd appreciate any suggestions because I'd like to provide feeds for my delegate.
My opinions do not represent those of metaexchange unless explicitly stated.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

monsterer

Quote from: xeroc on November 26, 2014, 09:35:28 AM
the statistics module should be a build-in module of python3!! (THREE!)

That's a bit disturbing, since I'm using python3 to run the command. My system does have an older python on the path, could it be finding some part of the original version, rather than the new one at run time?
My opinions do not represent those of metaexchange unless explicitly stated.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

xeroc

the statistics module should be a build-in module of python3!! (THREE!)

svk

Quote from: monsterer on November 26, 2014, 09:22:55 AM
Anyone know what I need to install to get access to the 'statistics' module?

ImportError: No module named 'statistics'

"pip install statistics" I guess?

I didn't need that one though but I'm using emski's version.
Worker: dev.bitsharesblocks

monsterer

Anyone know what I need to install to get access to the 'statistics' module?

ImportError: No module named 'statistics'
My opinions do not represent those of metaexchange unless explicitly stated.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

xeroc

#98
Quote from: emski on November 26, 2014, 07:46:15 AM
Quote from: xeroc on November 26, 2014, 07:32:57 AM
Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?
Just fixed it ...

I think your fix might ignore the price feeds from exchanges that haven't changed the name of BTS(X) .
Could you double check if I'm not missing something?

https://github.com/xeroc/pytshares/blob/master/btsx_feed.py#L419

But I will check again ..

edit: checked and decided that emski's solution is nicer :) .. update my script .. also made some variable renames and renamed the script ..

alt

Quote from: emski on November 26, 2014, 07:35:21 AM
Quote from: xeroc on November 26, 2014, 07:32:57 AM
Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?
Just fixed it ...

Yep. Me too. btc38 wasn't working yesterday for me. Now it looks OK.
thx,  fixed it too

emski

Quote from: xeroc on November 26, 2014, 07:32:57 AM
Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?
Just fixed it ...

I think your fix might ignore the price feeds from exchanges that haven't changed the name of BTS(X) .
Could you double check if I'm not missing something?
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]

emski

Quote from: xeroc on November 26, 2014, 07:32:57 AM
Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?
Just fixed it ...

Yep. Me too. btc38 wasn't working yesterday for me. Now it looks OK.
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]

xeroc

Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?
Just fixed it ...

Xeldal

I had to install the following to get feeds to work

apt-get install python3
apt-get install python3-requests
apt-get install python3-numpy


I didn't see this explicitly written anywhere so I thought I'd post it.

emski

#92
Quote from: svk on November 25, 2014, 08:22:31 PM
@alt @xeroc @emski Looks like btc38 just changed BTSX to BTS, think you need to update your scripts. Or am I late discovering this?

I dont get response from btc38. I dont think they changed the name. Perhaps they have different issue as they return empy page for the following request: http://api.btc38.com/v1/ticker.php?c=btsx&mk_type=CNY and an error for the following http://api.btc38.com/v1/ticker.php?c=bts&mk_type=CNY.
Strangely even http://api.btc38.com/v1/ticker.php?c=all&mk_type=BTC doesn't seem to return sane results (bts is missing).

I'm more concerned about scripts failing if the exchange returns incorrect data.
I'll fix it tomorrow.
For now you can disable btc38.

UPDATE: more info
UPDATE: I've pushed a fix for the script that will ignore malformed response from btc38 (only if exchange importance level is lower than 0.8 )
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]

alt

Quote from: monsterer on November 25, 2014, 06:29:24 PM
Just saw the notice about python3.

Now i'm getting this error:

python3 bts_feed_auto.py
  File "bts_feed_auto.py", line 93
    print "Warnning: rpc call error, retry 5 seconds later"
                                                          ^
SyntaxError: invalid syntax


Any ideas?
you need update scripts first

来自我的 HUAWEI P7-L00 上的 Tapatalk