Advanced case of showTips
Case 1: Mark the corresponding Romaji of Japanese kana
With this custom engine, you will be able to view the corresponding Romaji when you select Japanese kana
Add a new engine
Open the SearchJumper configuration page and add a new engine in your SearchJumper's "Search by Word" group.
Enter in the URL input.
showTips:https://translate.googleapis.com/translate_a/single?client=gtx&dt=t&dt=bd&dj=1&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=at&sl=ja&tl=zh_CN&q=%s
<h3 style='margin: 0;'>{name}</h3>
{json.sentences.all.trans}
<br>
<font style='display: block;' color='antiquewhite'>{json.sentences.all.orig}</font>
<font style='display: block;' color='yellow'>{json.sentences.-1.src_translit}</font>
The URL after showTips at the beginning represents the destination of the request after the word is marked, and %s represents the current word content.
The following is the HTML template that needs to be displayed after crawling, where:
{name}
is the current engine name.
{json.sentences.all.trans}
means getting the sentences
attribute from the returned json data, all
means traversing the attribute, taking all the trans
attributes and concatenating them.
{json.sentences.all.orig}
is the same as above, which means getting the sentences
attribute from the returned json data, traversing the attribute, taking all the orig
attributes and concatenating them.
{json.sentences.-1.src_translit}
means getting the sentences
attribute from the returned json data, -1
means taking the last member and taking the src_translit
attribute.
Then click "More Options" and enter [\u3040-\u309F\u30A0-\u30FF]
in "Filter Regular Expression". This means that the engine will only be displayed when Japanese Hiragana/Katakana is selected, and it will be hidden at other times.
Case 2: Convert USD to RMB
With this custom engine, you can calculate the corresponding RMB amount based on the current exchange rate when selecting USD
Add a new engine
Open the SearchJumper configuration page and add a new engine in your SearchJumper's "Search by Word" group.
Enter in the URL input
showTips:http://apilayer.net/api/convert?from=USD&to=CNY&amount=1&access_key=%template{apilayer key}
{name}
<br/>
<i>%s USD = {json.result|*%s.replace(/\D/g,'')} RMB</i>
Among them, the URL after showTips at the beginning represents the destination of the request after the word is marked, and %template
represents the private key named "apilayer key" set in "Export Settings".
The following is the HTML template that needs to be displayed after crawling, where:
{name}
is the current engine name.
{json.result|*%s.replace(/\D/g,'')}
represents getting the result
attribute from the returned json data, and |
represents the need to perform an operation on it. *
represents the multiplication of the previously returned content, and %s.replace(/\D/g,'')
represents the multiplier is the numeric part of the selected content.
Then click "More Options" and enter \d\$|\$\d
in "Filter Regular", which means that the engine is displayed only when $123
123$
is selected, and the engine is hidden at other times.
Case 3: Youdao Dictionary English to Chinese
With this custom engine, you will be able to view the corresponding Chinese when you select a single English word
Add a new engine
Open the SearchJumper configuration page and add a new engine in your SearchJumper's "Search by Word" group.
Enter in the URL input
showTips:https://dict.youdao.com/result?word=%s&lang=en
{.phone_con}
{.word-exp|<div style="font-size: 16px; line-height: initial; font-weight: normal;">()</div>}
The URL after showTips at the beginning represents the destination of the request after the word is selected.
The following is the HTML template that needs to be displayed after crawling, where:
{.phone_con}
represents the text content of the first element with the selector .phone_con
.
.word-exp
represents the element with the selector .word-exp
. |
represents the need to traverse all matching elements. The following is the production factory for each matching element, where (prop)
represents the prop attribute of each matching element, and leaving ()
blank represents taking the text content.
Then click "More Options" and enter ^[a-zA-Z]+$
in "Filter Regular Expression", which means that the engine is only displayed when English words are selected, and the engine is hidden at other times.