- 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
.env
andconfig.json
. - Saves wish history in separate json file at
home/pi-wish
dir.
- 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
.env
file:cp sample.env .env
-
Edit the
.env
file with the following information. Follow these steps to obtainTELEGRAM_API_TOKEN
andCHAT_ID
:FB_ID=your@email.here FB_PASS=mypassword TELEGRAM_API_TOKEN=telegramapikey CHAT_ID=yourchatid
-
Prepare the
config.json
file:cp sample.config.json config.json
-
Edit the
config.json
file with the following information.developer.headless
- Set to false for debugging (displays browser window)developer.dryRun
- Setfalse
to enable clicking the post button, true means it won't post to the user's timeline.developer.simulateDelay
- Settrue
to 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"]
, useid
field from URL -https://m.facebook.com/profile.php/?id=4
Default
config.json
file:{ "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
dist
dir at the project root folder.npm run build
-
Start
pi-wish
to 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.js
after you can check the status using
pm2 list
as 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.