Skip to content

Commit 5ccaf9c

Browse files
committed
create Gyazo Ivy Search Plugin
1 parent dfb8990 commit 5ccaf9c

8 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Gyazo Search in Spotlight plugin by Flashlight
2+
3+
![Screenshot](https://i.gyazo.com/9a8ffcd84835c1630088579565fb5150.png)
4+
5+
## keyword
6+
7+
- `gyazo <searchword>`
8+
- `gy <searchword>`
9+
10+
### :warning: Note about login
11+
12+
if it shows login page in webview, please login to Gyazo.com with your Safari.
187 KB
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gyazo ~keyword(kyoto)
2+
gy ~keyword(lgtm)
140 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"categories" : [
3+
"Utilities"
4+
],
5+
"displayName" : "Gyazo Search",
6+
"name" : "gyazo-search",
7+
"description" : "",
8+
"examples" : [
9+
"gyazo kyoto",
10+
"gy lgtm"
11+
]
12+
}
80.5 KB
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
def results(fields, original_query):
2+
keyword = fields['~keyword']
3+
html = (
4+
open("show.html").read().decode('utf-8')
5+
.replace("<!--KEYWORD-->", keyword)
6+
)
7+
return {
8+
"title": "Gyazo Seach '{0}'".format(keyword.encode('utf-8')),
9+
"run_args": [keyword.encode('utf-8')],
10+
"html": html,
11+
"webview_links_open_in_browser": True
12+
}
13+
14+
def run(message):
15+
import os, pipes
16+
os.system('open "https://gyazo.com/search/{0}"'.format(message.encode('utf8')))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html>
2+
<head>
3+
</head>
4+
<body data-keyword='<!--KEYWORD-->'>
5+
<script>
6+
setTimeout(function () {
7+
var keyword = document.querySelector('body').getAttribute('data-keyword')
8+
window.location = 'https://gyazo.com/search/' + keyword
9+
}, 300)
10+
</script>
11+
<h1 style="font-family: sans-serif;margin-bottom: 5px;"> Searching <!--KEYWORD--> </h1>
12+
<img style="width: 80%; margin: auto;margin-top: 0px;" src="./ninja.png" />
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)