diff options
Diffstat (limited to 'recipes/google-voice')
-rw-r--r-- | recipes/google-voice/icon.png | bin | 0 -> 5969 bytes | |||
-rw-r--r-- | recipes/google-voice/icon.svg | 1 | ||||
-rw-r--r-- | recipes/google-voice/index.js | 3 | ||||
-rw-r--r-- | recipes/google-voice/package.json | 15 | ||||
-rw-r--r-- | recipes/google-voice/webview.js | 26 |
5 files changed, 45 insertions, 0 deletions
diff --git a/recipes/google-voice/icon.png b/recipes/google-voice/icon.png new file mode 100644 index 0000000..1148ac5 --- /dev/null +++ b/recipes/google-voice/icon.png | |||
Binary files differ | |||
diff --git a/recipes/google-voice/icon.svg b/recipes/google-voice/icon.svg new file mode 100644 index 0000000..faeb8dc --- /dev/null +++ b/recipes/google-voice/icon.svg | |||
@@ -0,0 +1 @@ | |||
<svg height="297mm" viewBox="0 0 744.094 1052.362" width="297mm" xmlns="http://www.w3.org/2000/svg"><path d="m41.856744 824.21463c-1.614861-.88813-3.071569-5.61994-3.071569-5.61994l.698126-295.09107c.68499-289.53901.735057-295.20396 2.661027-301.09107 5.365113-16.39953 20.098832-29.21876 37.30731-32.45963 4.396562-.828 84.033972-1.05119 298.000002-.83517l292 .2948 5.79271 2.21083c18.12934 6.91921 29.06594 18.70029 32.57319 35.08839.82519 3.85578 1.1341 62.90429 1.1341 216.78155v211.48232l-2.08335 6.21846c-6.09125 18.18137-19.31869 30.63668-35.80314 33.71317-3.50982.65504-84.90771 1.00528-233.63157 1.00528h-228.24508l-35.36843 28.30746c-97.694064 78.19039-125.155006 99.69254-127.319854 99.69254-.76732 0-3.028611 1.19021-4.643472.30208zm518.003476-189.7363c7.90205-5.48065 7.53954-2.50201 7.55356-62.06578l.0125-53-2.23087-3.60763c-3.75191-6.06736-8.48514-7.65905-26.24373-8.82524-23.69866-1.55627-37.83254-4.28749-69.04032-13.34129-8.25398-2.39459-8.89959-1.93062-39.44712 28.34905-15.49473 15.35881-28.63117 27.92511-29.19214 27.92511-1.73088 0-19.22943-10.86926-31.22373-19.39468-40.31775-28.65741-77.52748-69.17384-97.93674-106.64002l-4.10444-7.53471 27.03835-26.96529c14.87109-14.83092 27.68359-28.18045 28.47222-29.66564 1.87199-3.5254 1.82864-10.9191-.0909-15.51332-5.04213-12.0675-9.84651-39.80736-11.34293-65.49258-1.01554-17.4313-2.19183-20.86503-8.43266-24.61605-3.0122-1.81046-6.2451-1.9569-55.19959-2.50038-55.03267-.61096-56.71905-.5022-61.67261 3.97759-1.12211 1.01479-2.9506 3.62887-4.06329 5.80907-1.85874 3.64197-1.96764 5.10418-1.34055 18 1.88101 38.68191 7.85801 73.94269 17.53371 103.43857 5.22271 15.92114 19.3507 47.63158 29.67125 66.59744 21.52402 39.55426 58.37139 82.14136 97.61288 112.8181 27.29056 21.33417 61.65711 39.7256 99.53055 53.26425 37.90456 13.54978 86.29525 22.40829 120.31705 22.02553 8.89112-.10003 9.89689-.32143 13.81959-3.0421z" fill="#4e8df5"/></svg> \ No newline at end of file | |||
diff --git a/recipes/google-voice/index.js b/recipes/google-voice/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/recipes/google-voice/index.js | |||
@@ -0,0 +1,3 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => Franz; \ No newline at end of file | ||
diff --git a/recipes/google-voice/package.json b/recipes/google-voice/package.json new file mode 100644 index 0000000..5bbf5c9 --- /dev/null +++ b/recipes/google-voice/package.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "id": "google-voice", | ||
3 | "name": "google-voice", | ||
4 | "version": "0.3.3", | ||
5 | "description": "Google Voice", | ||
6 | "main": "index.js", | ||
7 | "author": "Behind The Math <behindthemath@gmail.com>", | ||
8 | "license": "MIT", | ||
9 | "repository": "https://github.com/BehindTheMath/franz-recipe-google-voice", | ||
10 | "config": { | ||
11 | "serviceURL": "https://www.google.com/voice", | ||
12 | "hasTeamID": false, | ||
13 | "message": "Google Voice gives you one number for all your phones, voicemail as easy as email, free US long distance, low rates on international calls, and many calling features like transcripts, call blocking, call screening, conference calling, SMS, and more." | ||
14 | } | ||
15 | } | ||
diff --git a/recipes/google-voice/webview.js b/recipes/google-voice/webview.js new file mode 100644 index 0000000..1a91455 --- /dev/null +++ b/recipes/google-voice/webview.js | |||
@@ -0,0 +1,26 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | function parseQuery(query) { | ||
5 | const el = document.querySelector(query); | ||
6 | return el && parseInt(el.innerHTML) || 0; | ||
7 | } | ||
8 | |||
9 | function getMessages() { | ||
10 | const el = document.querySelector('.msgCount'); | ||
11 | let count; | ||
12 | |||
13 | if (el) { | ||
14 | count = parseInt(el.innerHTML.replace(/[\(\) ]/gi, '')) || 0; | ||
15 | } else { | ||
16 | const count_messages = parseQuery('gv-nav-tab[tooltip="Messages"] div[aria-label="Unread count"]'); | ||
17 | const count_calls = parseQuery('gv-nav-tab[tooltip="Calls"] div[aria-label="Unread count"]'); | ||
18 | const count_voicemails = parseQuery('gv-nav-tab[tooltip="Voicemail"] div[aria-label="Unread count"]'); | ||
19 | count = count_messages + count_calls + count_voicemails; | ||
20 | } | ||
21 | |||
22 | Franz.setBadge(count); | ||
23 | } | ||
24 | |||
25 | Franz.loop(getMessages); | ||
26 | }; \ No newline at end of file | ||