Probem with fbconsole

Ole Andreas Gløersen ole.andreas.gloersen at gmail.com
Sun Jan 4 12:03:18 EST 2015


I want to enter text msg and upload picture (so all friends can see and some private pictures) to my Facebook acount.

I'm working with fbconsole (it's important that it is text based command line) for setting up cron job on a Raspberry Pi.

My code:

import fbconsole

redirect_uri =  "https://local.fbconsole.com:8080/"
fbconsole.SITE_URL=redirect_uri

fbconsole.APP_ID = 'my_SW_ID'

fbconsole.AUTH_SCOPE = ['read_stream']
fbconsole.automatically_authenticate('my_FB_ID','my_FB_PWD','Security_code',fbconsole.SITE_URL,True)



My result:

pi at raspberrypi ~/facebook $ python f.py 
send: 'GET /dialog/oauth?scope=read_stream&state=Deletet....Deletet....&redirect_uri=https%3A%2F%2Flocal.fbconsole.com%3A8080%2F&client_id=Deletet.... HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.facebook.com\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Pragma: no-cache
header: Facebook-API-Version: v2.2
header: X-Frame-Options: DENY
header: Cache-Control: private, no-cache, no-store, must-revalidate
header: Expires: Sat, 01 Jan 2000 00:00:00 GMT
header: X-XSS-Protection: 0
header: X-Content-Type-Options: nosniff
header: Content-Type: text/html; charset=utf-8
header: X-FB-Debug: Deletet.............Deletet....
header: Date: Sun, 04 Jan 2015 16:51:31 GMT
header: Connection: close
Traceback (most recent call last):
  File "f.py", line 13, in <module>
    fbconsole.automatically_authenticate('Deletet....','Deletet....','Deletet....',fbconsole.SITE_URL,True)
  File "/usr/local/lib/python2.7/dist-packages/fbconsole.py", line 413, in automatically_authenticate
    browser.select_form(nr=0)
  File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 524, in select_form
    raise FormNotFoundError("no form matching "+description)
mechanize._mechanize.FormNotFoundError: no form matching nr 0
pi at raspberrypi ~/facebook $ 


Can anyone help me futher on?





More information about the Python-list mailing list