FacebookGreeter is a tiny Python utility that I used to greet all my Facebook Friends before leaving the social network. It is able to detect the Facebook language set by your friends and prepare a suitable message for each language. It is also able to show you every friend skipped because of errors and tries to recover the skipped friends at the second run of the program. Therefore, it also has a tiny database (a wrapper around pickle) to store information about your friends before writing on their walls.
FacebookGreeter depends on the official Facebook Python SDK, that can be obtained on GitHub.
def en_US(self, friend):
return """Dear """ + friend.first_name + """ """ + friend.last_name + """, because of the current and future
ways FB will handle our privacy, I decided to unsubscribe. I hope to stay in touch with you:
e-mail/Google Talk: email@example.com
[add as many as you want]
Best Regards (Message sent automatically)"""
def greet(self, friend):
if friend.locale == u'it_IT':
Q: Why have you developed this tool?
A: I was too lazy to manually write to all my Facebook “friends” to let them have the opportunity to contact me after my Facebook departure. Moreover, the Internet lacks a proper example on how to handle Facebook OAuth using Python. My program does and may be used for other purposes (see access.py)
Q: Can you help me to properly setup the program?
A: No. I left Facebook and I will never join it again. I left some instructions for how to use facebookgreeter.
Q: I don’t know know how to create a Facebook application. Can you help me?
A: No. I can not access Facebook Apps anymore. If you are a developer, you sure know how to handle this.
Q: I’ve just found a bug!
A: There are many. The program fails to send a Greet to Friends using non latin-1 characters but it will notice you of the failure, so you can manually greet them. Anyway, feel free to correct the bug, I won’t work on this program anymore
Q: The program looses Facebook authentication after some hours.
A: I know. Usually, a single Facebook OAuth lasts enough for announcing your Facebook departure. I don’t want to manage re-authentication, I don’t need it.
Q: The way you manage Greets is not elegant and hardcoded.
A: Yes, I know.
Q: But I..
A: No. I released the program because other people may make a good use of it, but I don’t want to hear about FB anymore.