Sunday, February 26, 2017

Connect Facebook by console in python (2)

____________________________________
Hi friend Welcome in my new tutorial
This small python code to connect to facebook via console

My name is vivek and i am read in class ix in rao ganga ram public school in kapashera i love coding
Its my hobby and my passion
____________________________________

1. #!/usr/bin/python
2. import logging
3. import csv
4. import fbconsole
5.
6.
7. logger = logging .getLogger ( 'root')
8. FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
9. logging .basicConfig (format=FORMAT )
10. logger.setLevel ( logging .DEBUG )
11.
12. def authenticate () :
13. logger.debug ('Authentication process' )
14. fbconsole.AUTH_SCOPE = ['publish_stream' , 'publish_checkins' ]
15. fbconsole.authenticate ()
16.
17.
18. def postMessage ( msg ):
19. logger.debug (msg )
20. status = fbconsole.post ('/me/feed' , { 'message' :msg })
21. print status
22.
23. def main () :
24. authenticate () ;
25.
26. if __name__ == '__main__' :
27. main ()
28. fbconsole.logout ()
29. postMessage ("3rd test" )

If you have any problem then you can contact me...................

My Email is : spy 91919@gmail.com

For more cool things you can see my facebook page Virus tricks

Thankyou !!

No comments:

Post a Comment