Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding=utf-8
- from fbchat import Client
- from fbchat.models import *
- import ConfigParser # Module for configuration-file read.
- import sys
- text = ''
- thread_id = ''
- thread_type = ''
- def facebook_send(username, password, fthread_id, fthread_type, ftext, ftext_arg):
- client = Client(username, password)
- client.send(Message(text=str(ftext) + ' az ΓΊj anyag pedig:' + str(ftext_arg)), thread_id=1867812176612833, thread_type=ThreadType.GROUP)
- client.logout()
- config = ConfigParser.RawConfigParser()
- config.read('facebook.properties')
- for section_name in config.sections():
- if config.has_option(section_name, 'USERNAME'):
- username = config.get(section_name, 'USERNAME')
- password = config.get(section_name, 'PASSWORD')
- fthread_id = config.get(section_name, 'THREAD_ID')
- fthread_type = config.get(section_name, 'THREAD_TYPE')
- ftext = config.get(section_name, 'TEXT')
- ftext_arg = sys.argv[1]
- facebook_send(username, password, fthread_id, fthread_type, ftext, ftext_arg)
- else:
- print("The following parameter required:",section_name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement