[erlang-questions] Twitter Account Activity API (webhooks) problems

Peter Andersson pekadan@REDACTED
Wed Oct 17 16:32:09 CEST 2018


Hi Marc,

Just wanted to let you know that I got my problem solved thanks to you. I
used erlang-oauth to generate the signature, but not to create the POST
request to Twitter. It looked to me like the form of the erlang-oauth
request did not match the Twitter API spec. However, reading the Zotonic
twitter client code I noticed that it uses oauth:post/5, so I checked the
form of this POST request again, compared it to my own, and realized I had
made mistakes (I must have misunderstood the Twitter API docs).

Thanks again for helping! I truly appreciate it!

  Peter

On Tue, Oct 16, 2018 at 2:59 PM Peter Andersson <pekadan@REDACTED> wrote:

> Thanks a lot Marc for the help and pointers, much appreciated!
>
> I'll take a look at your oauth code. Maybe it can give me some new ideas.
>
> A polling solution could maybe be a workaround for me, at least until I
> manage to get that webhook up and running.
>
>   Peter
>
> On Tue, Oct 16, 2018 at 10:34 AM Marc Worrell <marc@REDACTED> wrote:
>
>> Ah yes… was a bit confused.  Forget about twerl and just poll the other
>> Twitter APIs.
>>
>> We use oauth for the authentication and calls.
>>
>> Here are the controllers that do the “OAuth dance”:
>>
>>
>> https://github.com/zotonic/zotonic/tree/master/apps/zotonic_mod_twitter/src/controllers
>>
>> We use this oauth library (copied from rebar.config):
>>
>> {oauth, ".*", {git, "https://github.com/tim/erlang-oauth.git", {tag,
>> "v1.6.0"}}}
>>
>>
>> - Marc
>>
>>
>> On 16 Oct 2018, at 10:27, Peter Andersson <pekadan@REDACTED> wrote:
>>
>> Marc,
>>
>> Does your twerl fork actually still work?? If I'm not missing something,
>> it's based on the streaming API that Twitter shut down in August. Is
>> Zotonic using a different twerl fork, or a different Twitter client app
>> altogether?
>>
>>   Peter
>>
>> On Tue, Oct 16, 2018 at 8:32 AM Marc Worrell <marcw@REDACTED> wrote:
>>
>>> In Zotonic we are using a twerl fork.
>>>
>>> https://github.com/mworrell/twerl.git
>>>
>>> This works well, am on the road so can’t readily checked what we changed.
>>>
>>> - Marc
>>>
>>>
>>> Sent from my iPhone
>>>
>>> On 16 Oct 2018, at 07:25, Ivan Uemlianin <ivan@REDACTED> wrote:
>>>
>>> Dear Peter
>>>
>>> I have an old erlang twitter client (using oauth) that used to work.
>>> When I get to the office I’ll see if it still works (twitter change their
>>> api regularly) & if so might be able to help.
>>>
>>> It began as a fork of twerl:
>>>
>>>     https://github.com/lucaspiller/twerl
>>>
>>> Best wishes
>>>
>>> Ivan
>>>
>>>
>>> --
>>> festina lente
>>>
>>>
>>> On 16 Oct 2018, at 00:34, Peter Andersson <pekadan@REDACTED> wrote:
>>>
>>> Hi,
>>>
>>> I'm working on an Erlang app interfacing Twitter using the Account
>>> Activity API and I can't get the app and default user to pass
>>> authentication. I started out using the erlang-oauth lib on github (
>>> https://github.com/tim/erlang-oauth) to generate a valid oauth 1.0
>>> signature, but then Twitter authentication failed and I did my own oauth
>>> signing function. My function produced the exact same result as
>>> erlang-oauth though (go figure!), so the signature itself is probably not
>>> an issue. Maybe I'm not getting the parameters right, or the actual request.
>>>
>>> Anyone on the list been interfacing Twitter from an Erlang program using
>>> webhooks? If so, would you mind sharing some knowledge? I would really
>>> appreciate seeing an example of a working webhook URL registration (POST to
>>> the account_activity endpoint in user context).
>>>
>>> Thanks,
>>> Peter
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181017/a9d42e67/attachment.htm>


More information about the erlang-questions mailing list