Question

I want to send authorize request to twitter API in order to get followers ids, i got access token and access token secret by creating a new application as shown here. I have no idea how to send authorize request in pharo smalltalk.

I want to get followers ids by performing this in pharo smalltalk . I wanna know if there is any documentation or packages that can help me with this.

Here is the code i tried to work with.

|client|
client:= ZnClient new.
client https;
host: 'www.api.twitter.com/1.1/followers/ids.json';
queryAt: 'q' put: 'cursor=-1&screen_name=my name'.
client request headers at: 'Authorization' put:' OAuth  oauth_consumer_key="Hp6FpBU7Bbqv89RqrHJzHw", oauth_nonce="9677be3a12e128702b06348677319e75", oauth_signature="GUQR%2FI%2Bd0XhQLJP5B0IHtDfiiLE%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1387729271", oauth_token=" my acess token", oauth_version="1.0" '. 
client get.
Was it helpful?

Solution

Welcome to Pharo community, Irfan.

You should take a look at Zinc framework. Here is a very nice documentation, you should be able to solve your problem after reading it.

Also as far as I know there is work in progress on the OAuth protocol, you can take a look here: https://github.com/svenvc/docs/blob/master/zinc/zinc-sso-paper.md. You definitely want to take a look at it because there are also 2 demos where you can interact with twitter

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top