DJNeo Posted February 23, 2017 Report Posted February 23, 2017 my $mech = WWW::Mechanize->new(); $mech->get("https://blockchain.info/q/getreceivedbyaddress/".$btcaddress); # Check transactions on bitcoin address my $getreceived = $mech->content; $mech->get("https://blockchain.info/q/addressbalance/".$btcaddress); # Check balance on bitcoin address my $addressbalance = $mech->content; Exemplu rezultat: https://blockchain.info/q/getreceivedbyaddress/1GbVUSW5WJmRCpaCJ4hanUny77oDaWW4to => 900403294973 https://blockchain.info/q/addressbalance/1GbVUSW5WJmRCpaCJ4hanUny77oDaWW4to => 51689529709 Daca folosesc blockexplorer.com https://blockexplorer.com/api/addr/1GbVUSW5WJmRCpaCJ4hanUny77oDaWW4t ,rezultatul este...hacea-parcea. Ca sa am acelasi rezultat ca pe blockchain,trebuie sa pun /balance dupa link,respectiv /totalReceived https://blockexplorer.com/api/addr/1GbVUSW5WJmRCpaCJ4hanUny77oDaWW4to/balance https://blockexplorer.com/api/addr/1GbVUSW5WJmRCpaCJ4hanUny77oDaWW4to/totalReceived Acum...cum pun in cod..."/balance" si "/totalReceived" !? Am incercat gen: $mech->get("https://blockexplorer.com/api/addr/".$btcaddress/balance); # Check transactions on bitcoin address $mech->get("https://blockexplorer.com/api/addr/".$btcaddress./balance); # Check transactions on bitcoin address $mech->get("https://blockexplorer.com/api/addr/".$btcaddress "/balance"); # Check transactions on bitcoin address $mech->get("https://blockexplorer.com/api/addr/.$btcaddress/balance"); # Check transactions on bitcoin address insa...nici-o versiune nu functioneaza... Astept un mic ajutor de la cunoscatori Quote
pr00f Posted February 23, 2017 Report Posted February 23, 2017 Hint, ce vrei tu sa faci se numeste concatenare. Tu faci deja asta: "https://blockchain.info/q/getreceivedbyaddress/".$btcaddress Adica: "text" . $variabila Iar tu ai nevoie de: "text" . $variabila . "text in continuare" Respectiv, $mech->get("https://blockexplorer.com/api/addr/".$btcaddress . "/balance"); 1 Quote
DJNeo Posted March 12, 2017 Author Report Posted March 12, 2017 Apreciez insa...am incercat deja asa...dupa cum am si specificat incercarile esuate... Quote
BogdanNBV Posted March 12, 2017 Report Posted March 12, 2017 (edited) 22 minutes ago, DJNeo said: Apreciez insa...am incercat deja asa...dupa cum am si specificat incercarile esuate... In lista cu incercari esuate nu ai inclus ce ti-a propus @pr00f Tu ai incercat: $mech->get("https://blockexplorer.com/api/addr/".$btcaddress "/balance"); Iar el ti-a propus: $mech->get("https://blockexplorer.com/api/addr/".$btcaddress . "/balance"); Punctul ala ce-l ai si inainte de variabila "$btcaddress" este operatorul de concaternare in Perl. Edited March 12, 2017 by BogdanNBV Quote