Skip to content

Commit

Permalink
Support for multiple NFT wallets. Updated user config.
Browse files Browse the repository at this point in the history
Added support for multiple NFT wallets. Removed user configuration from inside the script. Only need to provide email address when executing the script. Fixed issue with urlencode urls. (Ex. %20 instead of a space in the URL)
  • Loading branch information
steppsr authored Jul 22, 2022
1 parent e38ed06 commit 2528eef
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
22 changes: 19 additions & 3 deletions nftmon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ sudo apt install curl
sudo apt install ssmtp
sudo apt install mailx
sudo apt install jq
sudo apt install tr
```

**UPDATE**
> All user configuration has been removed and you do not need to edit the script.
> You **will** need to add the email address to command line when executing the script.
---

**Setting up ssmtp (using a Gmail account)**

Since I have 2-factor authentication turned on for Gmail in order to get my Gmail account set up in ssmtp I had to set up an App Password. Below is a link to Google on how to do that, but I also listed the steps out. You will need to securely save that App Password. I will use _APP_PASSWORD_ as a placeholder in the code, you need to replace that with your actual App Password.

Also, email isn't required so you can skip this step if you aren't comfortable with an App Password.
Expand Down Expand Up @@ -79,30 +86,39 @@ You should have received an email in your Gmail inbox.
---

**How to run the script**

**UPDATE** Be sure to include the email address when executing the script. This is now the only user configuration needed. There is no need to edit the script.

```
bash nftmon.sh
bash nftmon.sh [email protected]
```

---

**Change the permissions to make the script executable**

```
chmod +x nftmon.sh
```

---

**Add the script into Crontab**

Let's add a line into crontab so the script will run every minute. First open crontab.

```
crontab -e
```

Then add the following to run every minute.

```
* * * * * YOUR_APP_FOLDER/nftmon.sh
* * * * * YOUR_APP_FOLDER/nftmon.sh [email protected]
```

Real example:

```
* * * * * ~/xchdev_tools/nftmon/nftmon.sh
* * * * * ~/xchdev_tools/nftmon/nftmon.sh [email protected]
```
11 changes: 11 additions & 0 deletions nftmon/nftmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,14 @@ rm $appdir/.newurls.html
# v0.2.1 - Changes:
# - Changed from 'echo' to 'printf' for writing out the uris so the file ends up with one URL per line.
# echo was wasn't putting each URL on a newline which caused the email to send all NFTs not just new ones.
#
# v0.3.0 - Changes:
# - Changed from using 'ssmtp' to 'mailx' command to send HTML email without using 'echo' or 'printf', which
# were causing issues for urls with spaces urlencoded (ex. %20)
# - Removed user configuration in script. No editing of the script is required after downloading. There is a
# new method to running the script. You will need to add the send to email after the name of the script
# when executing the script. Ex. '$ bash nftmon.sh [email protected]'
# New features:
# - The script now supports multiple NFT wallets with no setup required. The script will gather all NFTs in
# all NFT wallets automatically.

0 comments on commit 2528eef

Please sign in to comment.