Fetching https site content with Zinc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fetching https site content with Zinc

Henrique Rocha
Hi there,

I am trying to automate the fetching of a site content in Pharo. Basically, I want to fetch smart contract information from Etherscan. Here is an example URL: https://etherscan.io/address/0xbcff2d15c698d3874bc29aa170c89fd7a6146a4b#code

I tried to use Zinc to fetch that, here is my code (very simple):

ZnEasy get: 'https://etherscan.io/address/0x9C169d81420aAD7D8a0D6d9F295C3ba2C33575De#code'

Although it runs without errors the fetched content is "Bad Request - Invalid URL" and not the actual website.

Anyone know what am I doing wrong here?
Reply | Threaded
Open this post in threaded view
|

Re: Fetching https site content with Zinc

Esteban A. Maringolo
Hi,

Probably, the hashbang (#code) is causing the front end proxy to
respond with a 400 error.

It works if you do:
ZnEasy get:  'https://etherscan.io/address/0xbcff2d15c698d3874bc29aa170c89fd7a6146a4b'

However, I think there might be an specify REST API to get the
Solidity code of that SmartContract.

Also, you can use an available Pharo driver for Ethereum:
https://github.com/sbragagnolo/Fog

I'm not familiar with Ethereum, but according to Fog's docs you can
get the contract doing:

FogConnection eth  getContract: 'ContractHash'  blockTag: 'latest'

Regards!


Esteban A. Maringolo


2017-08-07 9:16 GMT-03:00 Henrique Rocha <[hidden email]>:

> Hi there,
>
> I am trying to automate the fetching of a site content in Pharo. Basically,
> I want to fetch smart contract information from Etherscan. Here is an
> example URL:
> https://etherscan.io/address/0xbcff2d15c698d3874bc29aa170c89fd7a6146a4b#code
>
> I tried to use Zinc to fetch that, here is my code (very simple):
>
> ZnEasy get:
> 'https://etherscan.io/address/0x9C169d81420aAD7D8a0D6d9F295C3ba2C33575De#code'
>
> Although it runs without errors the fetched content is "Bad Request -
> Invalid URL" and not the actual website.
>
> Anyone know what am I doing wrong here?
>
>
>
> --
> View this message in context: http://forum.world.st/Fetching-https-site-content-with-Zinc-tp4959072.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>