Browse Source

sketch template customization

Federico Bonelli 2 years ago
parent
commit
a4595a0b15
2 changed files with 0 additions and 49 deletions
  1. BIN
      ArcTouch Mobile UX Templates copy.sketch
  2. 0 49
      ys

BIN
ArcTouch Mobile UX Templates copy.sketch


+ 0 - 49
ys

@@ -1,49 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# 2f30
4
-# search youtube via api
5
-
6
-[ -n "$TORIFY" ] && proxy="--proxy socks5://127.0.0.1:9050"
7
-
8
-KEY="AIzaSyAa5gAarPnuu9zTVjpp6mPyStbY17uuhSE"
9
-NRES=10
10
-
11
-search() {
12
-	sstr=""
13
-	if [ ${#} -ne 1 ]; then
14
-		for arg in $@; do
15
-			sstr=$sstr"$arg+"
16
-			#sstr=$sstr"$arg|"
17
-		done
18
-	else
19
-		sstr=$1
20
-	fi
21
-
22
-	json="$(curl -s ${proxy} \
23
-		-G "https://www.googleapis.com/youtube/v3/search" \
24
-		-d part="snippet" \
25
-		-d q=$sstr \
26
-		-d maxResults=$NRES \
27
-		-d key=$KEY | \
28
-		jq '[.items[] | {"title":.snippet.title,
29
-			"url": ["https://www.youtube.com/watch?v=" + .id.videoId] }]' -)"
30
-
31
-	printf -- "---------------------------------------------\n"
32
-	for i in $(seq 0 $(( $NRES - 1)) ); do
33
-		printf "%s" "$json" | jq ".[${i}].title"
34
-		printf "%s" "$json" | jq ".[${i}].url[]"
35
-		printf -- "---------------------------------------------\n"
36
-	done
37
-}
38
-
39
-case $1 in
40
-	-n)
41
-		NRES=$2
42
-		shift 2
43
-		search $@
44
-		;;
45
-	*)
46
-		search $@
47
-		;;
48
-esac
49
-