This BOT will allow you to send automatic birthday wishes for your facebook friends every single day
By AdemKouki : https://about.me/AdemKouki
Requirements :
- VPS (or your local machine)
- Python (3.5.0 or higher)
- Facebook Account (for sure ๐)
- LAMP server (or anything similar)
-
First, you need to download these files..
-
Login to your facebook account, then open This link
- Right-click the link Birthdays , copy the url. You will get a link like this
webcal://web.facebook.com/ical/b.php?uid=100001217614623&key=XXXXXXXXXXXXXXXX
Replace the webcal:// with https:// like this :
https://web.facebook.com/ical/b.php?uid=100001217614623&key=XXXXXXXXXXXXXXXX
- You will get a file with .ics extension :
( iCalendar file: These are plain text files that include calendar event details like a description, beginning and ending times, location, etc. )
-
Make a new folder and put all files (ics file you download it from fb + github files) Together in the same folder
-
Rename the .ics file you download it from facebook as : cal.ics ( you must delete the old cal.ics file of course ๐ )
wish = ['Hi {0}, Happy Birthday ^^']
{0} is your friend facebook name ... for example :
if your friend's name is "Adem", the message will be : Hi Adem, Happy Birthday ^^
You can also make random wishes ; Example :
wish = ['Hi {0}, Happy Birthday ^^' ,
'Love You {0}' ,
'How are you {0}]',
'Bla Bla Bla {0}']
The bot will select a random wish for every friend ;)
- Example 1 :
images = ['https://i.imgur.com/oDEGLBY.jpg']
- Example 2 (Random Image) :
images = ['https://i.imgur.com/oDEGLBY.jpg',
'https://i.imgur.com/7qffkxy.png',
'https://i.imgur.com/5KOX5Vo.png',]
You need to use your facebook username & password :
username = 'login@emailfb.com'
password = 'yourpassword'
You can change the time when your bot will send messages :
schedule.every().day.at("12:33").do(BirthdayWish)
In this exemple the bot will send wishes at 12:33 change it as you like :D
After configuration, you need to put the folder in your LAMP (the default directory var/www/) in your VPS
- Open your browser and go to this URL :
http://{{server-ip-adress}}/birthdaybot/
it will says "Everything is OK" ...
- Then,you must use screen :
Screen allows you to:
- Use multiple shell windows from a single SSH session.
- Keep a shell active even through network disruptions.
- Disconnect and re-connect to a shell sessions from multiple locations.
- Run a long running process without maintaining an active shell session.
cd var/www/birthdaybot
screen -S birthdaybot
- you need to install python requirements using pip :
pip install -r requirements.txt
Finally, Start Your bot :D
python bot.py
Don't forget to detach from your session :
Press [Ctrl+a] then [Ctrl+d]