forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch-in-dndbeyond.sh
executable file
·81 lines (76 loc) · 1.88 KB
/
search-in-dndbeyond.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Search in DnDBeyond.com
# @raycast.mode silent
# @raycast.author Chris Koerner Zeller
# @raycast.authorURL https://github.com/ChessMess
# Optional parameters:
# @raycast.icon ./images/ddbicon.png
# @raycast.packageName Web Searches
# @raycast.argument1 { "type": "text", "placeholder": "Searching for", "percentEncoded": true }
# @raycast.argument2 { "type": "text", "placeholder": "Category", "optional": true}
# @raycast.argument3 { "type": "text", "placeholder": "Subcategory", "optional": true}
case ${2} in
'c'|'ch'|'cha'|'char'|'character'|'characters')
c='characters'
f='spells,backgrounds,classes,feats,races'
;;
'cl'|'class'|'classes')
c='characters'
f='classes'
;;
'com'|'compendium')
c='compendium'
f='actions,compendium,conditions,skills,rules,weapon-property'
;;
'e'|'eq'|'equip'|'equipment')
c='equipment'
f='equipment,magic-items'
;;
'f'|'fe'|'ft'|'feat'|'feats')
c='characters'
f='feats'
;;
'i'|'it'|'ite'|'itm'|'item'|'items')
c='items'
f='equipment,magic-items'
;;
'm'|'mag'|'magic'|'magical')
c='items'
f='spells,magic-items'
;;
'mi'|'magicitems'|'magic items'|'magic-items')
c='items'
f='magic-items'
;;
'r'|'ra'|'rac'|'race'|'races')
c='characters'
f='races'
;;
'r'|'rule'|'rules')
c='rules'
f='rules'
;;
's'|'sp'|'spell'|'spells')
c='spells'
f='spells'
;;
'sk'|'skill'|'skills')
c='skills'
f='skills'
;;
'v'|'vehicle')
c='vehicle'
f='vehicle'
;;
'w'|'weap'|'weapon')
c='equipment'
f='equipment,magic-items'
;;
*)
c=${2}
f=${3}
;;
esac
open "https://dndbeyond.com/search?q=${1}&c=${c}&f=${f}"