Author Topic: publish feed price automatic(From BitSuperLab)  (Read 40188 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
you could also check with
Code: [Select]
$ python3
import statistics

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
if you are running ubuntu1404, you can try to find the file and check if the package install correct

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

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.

Offline monsterer

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.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline monsterer

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.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
the statistics module should be a build-in module of python3!! (THREE!)

Offline svk

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

Code: [Select]
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

Offline monsterer

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

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

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@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 ..
« Last Edit: November 26, 2014, 08:22:54 am by xeroc »

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
@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

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
@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?

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
@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.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@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

  • Guest
I had to install the following to get feeds to work

Code: [Select]
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.

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
@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 )
« Last Edit: November 25, 2014, 11:55:31 pm by emski »

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Just saw the notice about python3.

Now i'm getting this error:

Code: [Select]
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