- Ability to auto login.
- Automated birthday wishes for Facebook friends.
- Customized birthday messages based on friend IDs.
- Custom/Random message for friend.
- Random Delay for each wish.
- Telegram integration for notifications.
- Scheduled execution with cron job.
- Customizable configuration options through
.envandconfig.json. - Saves wish history in separate json file at
home/pi-wishdir.
- node: Tested on version 18.18.0
- pm2: You can install using
npm install pm2@latest -g, more detail found at here - chromium-browser: to install check this link
- Telegram account (Optional): For notification, Bot and chat ID
-
Clone this project:
git clone https://github.com/gajjartejas/pi-wish.git
-
Change to the project directory:
cd pi-wish -
Install required
node_modules:npm install
-
Prepare the
.envfile:cp sample.env .env
-
Edit the
.envfile with the following information. Follow these steps to obtainTELEGRAM_API_TOKENandCHAT_ID:FB_ID=your@email.here FB_PASS=mypassword TELEGRAM_API_TOKEN=telegramapikey CHAT_ID=yourchatid -
Prepare the
config.jsonfile:cp sample.config.json config.json
-
Edit the
config.jsonfile with the following information.developer.headless- Set to false for debugging (displays browser window)developer.dryRun- Setfalseto enable clicking the post button, true means it won't post to the user's timeline.developer.simulateDelay- Settrueto enable delay between clicks.developer.simulateDelayInSeconds- delay between clicks/navigation, default is 5 seconds.excludeProfileIds- It will not wish to provide profile ids.includedProfileIds- It will only wish to provide profile ids.randomDelayForWish- Adds random delay between wishes.randomDelayRangeInSeconds- Range forrandomDelayForWish, ex:[0, 100]customBirthdayMessages- Use a specified message for a wish.telegramNotificationsEnabled- Enable disable telegram notification.telegramDebugNotificationsEnabled- Enable debug logs on telegram notification, prints exception if any.disableImageLoading- Disable loading images in browser.enableNewReleaseCheck- Enable to check new release updates on startups.
Note: Example Ids:
["4", "5"], useidfield from URL -https://m.facebook.com/profile.php/?id=4Default
config.jsonfile:{ "developer": { "headless": true, "dryRun": false, "simulateDelay": false, "simulateDelayInSeconds": 5000 }, "excludeProfileIds": [], "includedProfileIds": [], "randomDelayForWish": false, "randomDelayRangeInSeconds": [0, 100], "customBirthdayMessages": [ { "message": "Happy birthday!!!", "ids": [""] } ], "telegramNotificationsEnabled": true, "telegramDebugNotificationsEnabled": true, "disableImageLoading": true, "enableNewReleaseCheck": true } -
Build the project using the below command, this will produce
distdir at the project root folder.npm run build
-
Start
pi-wishto run at 11:00, 17:00, and 20:00 every day [see below command'0 11,17,20 * * *']. Adjust the schedule using this tool: The first time it will try to collect friends' birthdays and try to wish each one by one, if fails it will try again(17:00 and 20:00) when the cron job runs for remaining friends.pm2 start --cron-restart '0 11,17,20 * * *' --no-autorestart --name pi-wish dist/src/main.jsafter you can check the status using
pm2 listas it will show the process status belowid name namespace version mode pid uptime ↺ status cpu mem user watching 0 pi-wish default 1.0.0 fork 22697 0s 0 online 0% 19.9mb tejas disabled you can stop the process using
pm2 stop 0.
Use git pull && npm install && npm run build to update and build updated dist.
- Code cleanup.
- Better error handling.
- Friend/Unfriend tracker.
- Send a birthday message if not able to post on the timeline.
- Send custom message at custom date.