Libraryless. Click here for Pure Java version (3912L/26K).
1 | static LS qwantImageSearch(S query) {
|
2 | S page = loadPageWithUserAgentAndTimeout("https://api.qwant.com/api/search/images" + hquery(
|
3 | count := 50, |
4 | q := query, |
5 | t := "images", |
6 | safesearch := 1, |
7 | locale := "en_US", |
8 | uiv := 4), |
9 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", |
10 | 10.0); |
11 | print(page); |
12 | Map map = jsonDecodeMap(page); |
13 | Map map2 = cast mapGet(map, "data"); |
14 | Map map3 = cast mapGet(map2, "result"); |
15 | L<Map> items = cast mapGet(map3, "items"); |
16 | ret collect media(items); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027025 |
| Snippet name: | qwantImageSearch |
| Eternal ID of this version: | #1027025/3 |
| Text MD5: | 84fe431029b8a80bf5a94237d5634903 |
| Transpilation MD5: | 32df5cb24e342d02a07a11c1d4d53e4e |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-02-10 19:22:53 |
| Source code size: | 596 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 560 / 737 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |