W3C home > Mailing lists > Public > public-rww@w3.org > July 2012

Re: Using MyProfile from the command line?

From: Melvin Carvalho <melvincarvalho@gmail.com>
Date: Wed, 11 Jul 2012 11:10:55 +0200
Message-ID: <CAKaEYhK8Nn-suH6LoBKonEnZA0Y7Wr6iqjg5Y+sA4moBHTSQ2g@mail.gmail.com>
To: Andrei Sambra <andrei@fcns.eu>
Cc: public-rww@w3.org
On 10 July 2012 17:42, Melvin Carvalho <melvincarvalho@gmail.com> wrote:

>
>
> On 10 July 2012 11:53, Melvin Carvalho <melvincarvalho@gmail.com> wrote:
>
>>
>>
>> On 7 July 2012 16:43, Andrei Sambra <andrei@fcns.eu> wrote:
>>
>>> Hi Melvin,
>>>
>>>
>>> On 07/07/12 14:44, Melvin Carvalho wrote:
>>>
>>>> Has anyone been able to make a wall post from the command line?  I
>>>> tried the following unsuccessfully :
>>>>
>>>> echo "user=local&new=1&comment=**curltest"  | curl -X POST -E
>>>> e.pemhttps://my-profile.eu/**wall.php <http://my-profile.eu/wall.php>
>>>>
>>>> Any ideas?
>>>>
>>>>  I don't think you'll be able to do that, since posting on the wall
>>> requires the user to be authenticated through a session. Therefore, your
>>> script would first have to authenticate (same link as the WebID button) and
>>> save the session cookie, and only then post the message.
>>>
>>
>> I've slightly modified the python script you gave me to get this to work:
>>
>> #!/usr/bin/env python
>>
>> import urllib
>> import httplib2
>>
>> cert_file = 'e.pem'
>>
>> http = httplib2.Http(disable_ssl_certificate_validation=True)
>> http.add_certificate('', cert_file, domain='')
>>
>> url = '
>> https://auth.my-profile.eu/auth/index.php?authreqissuer=https://my-profile.eu/index.php
>> '
>> response, content = http.request(url)
>>
>> headers = {'Cookie': response['set-cookie'], 'Content-type':
>> 'application/x-www-form-urlencoded'}
>>
>> newurl = 'https://my-profile.eu/wall.php'
>> body = { 'comment' : 'curltest', 'user' : 'local', 'new' : '1' }
>> response, content = http.request(newurl, 'POST', headers=headers,
>> body=urllib.urlencode(body))
>>
>> https://gist.github.com/3082339
>>
>
> Note also if you change 'user' : 'local' to your wall's id, it will post
> to your personal stream, rather than the global one.
>
> You can find your wall id by going to 'subscription'
>

I have this working quite well from a command line now.

I'm reposting things like tweets to my news feed so that only my friends
circle can see it.  This is quite similar to the facebook UI that got it so
much success.

I'm thinking next about a 'share' bookmarklet, something along the lines of

https://dev.twitter.com/docs/share-bookmarklet

The idea would be to share a post to my news feed if I came across an
interesting page

LMK if anyone has experience of interesting bookmarklets ...


>
>
>>
>>
>>
>>>
>>> Andrei
>>>
>>>
>>>
>>
>
Received on Wednesday, 11 July 2012 09:11:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 11 July 2012 09:11:24 GMT