Browse Source

Merge remote-tracking branch 'upstream/master' into master

Conflicts:
    tmpmail
Ryan Delaney 5 years ago
parent
commit
ccce4bdb0b
2 changed files with 25 additions and 6 deletions
  1. 21 2
      README.md
  2. 4 4
      tmpmail

+ 21 - 2
README.md

@@ -15,14 +15,33 @@ use the `--browser` argument followed by the command needed to launch the web br
 <br>
 <br>
 
-## Requirements
+## Dependencies
 - `w3m`
 - `curl`
 - [`jq`](https://github.com/stedolan/jq)
+- `awk`
+
+## Installation
+### Install locally
+
+```bash
+# Download the tmpmail file and make it executeable
+$ curl -L "https://git.io/tmpmail" > tmpmail && chmod +x tmpmail
+
+# Then move it somewhere in your $PATH. Here is an example:
+$ mv tmpmail ~/bin/
+```
+
+### AUR
+`tmpmail` is available on the [AUR](https://aur.archlinux.org/packages/tmpmail-git/), which is currently being maintained by [Benjamin Bädorf](https://github.com/b12f)
+
+```bash
+$ yay -S tmpmail-git
+```
 
 ## Usage
 ```console
-usage: tmpmail [-h] [--generate] [--browser BROWSER] [--recent] ID
+usage: tmpmail [-h] [--generate] [--text] [--browser BROWSER] [--recent] ID
 
 optional arguments:
 -h, --help           Show this help message

+ 4 - 4
tmpmail

@@ -5,10 +5,10 @@
 # Dependencies: jq, curl, w3m
 #
 
+export LC_ALL=C
 export LC_CTYPE=C
-export LANG=C
 
-VERSION=1.0.0
+VERSION=1.0.3
 
 # By default 'tmpmail' uses 'w3m' as it's web browser to render
 # the HTML of the email
@@ -109,7 +109,7 @@ list_emails(){
     # List all the received emails in a nicely formatted order
     #
     # Fetch the email data using 1secmail's API
-    DATA=$(curl -sL "http://1secmail.$TLD/api/v1/?action=getMessages&login=$USERNAME&domain=1secmail.$TLD")
+    DATA=$(curl -sL "https://1secmail.com/api/v1/?action=getMessages&login=$USERNAME&domain=1secmail.$TLD")
 
     # Using 'jq' we get the length of the JSON data. From this we can determine whether or not
     # the email address has gotten any emails
@@ -183,7 +183,7 @@ view_email(){
     # The first argument provided to this function will be the ID of the email
     # that has been received
     EMAIL_ID="$1"
-    DATA=$(curl -sL "http://www.1secmail.$TLD/api/v1/?action=readMessage&login=$USERNAME&domain=1secmail.$TLD&id=$EMAIL_ID")
+    DATA=$(curl -sL "https://www.1secmail.com/api/v1/?action=readMessage&login=$USERNAME&domain=1secmail.$TLD&id=$EMAIL_ID")
 
     # After the data is retrieved using the API, we have to check if we got any emails.
     # Luckly 1secmail's API is not complicated and returns 'Message not found' as plain text