Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Gyazo Ivy Search Plugin #536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions PluginDirectories/1/gyazo-search.bundle/README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Gyazo Search in Spotlight plugin by Flashlight

![Screenshot](https://i.gyazo.com/9a8ffcd84835c1630088579565fb5150.png)

## keyword

- `gyazo <searchword>`
- `gy <searchword>`

### :warning: Note about login

if it shows login page in webview, please login to Gyazo.com with your Safari.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions PluginDirectories/1/gyazo-search.bundle/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gyazo ~keyword(kyoto)
gy ~keyword(lgtm)
Binary file added PluginDirectories/1/gyazo-search.bundle/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions PluginDirectories/1/gyazo-search.bundle/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"categories" : [
"Utilities"
],
"displayName" : "Gyazo Search",
"name" : "gyazo-search",
"description" : "",
"examples" : [
"gyazo kyoto",
"gy lgtm"
]
}
Binary file added PluginDirectories/1/gyazo-search.bundle/ninja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions PluginDirectories/1/gyazo-search.bundle/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def results(fields, original_query):
keyword = fields['~keyword']
html = (
open("show.html").read().decode('utf-8')
.replace("<!--KEYWORD-->", keyword)
)
return {
"title": "Gyazo Seach '{0}'".format(keyword.encode('utf-8')),
"run_args": [keyword.encode('utf-8')],
"html": html,
"webview_links_open_in_browser": True
}

def run(message):
import os, pipes
os.system('open "https://gyazo.com/search/{0}"'.format(message.encode('utf8')))
14 changes: 14 additions & 0 deletions PluginDirectories/1/gyazo-search.bundle/show.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
</head>
<body data-keyword='<!--KEYWORD-->'>
<script>
setTimeout(function () {
var keyword = document.querySelector('body').getAttribute('data-keyword')
window.location = 'https://gyazo.com/search/' + keyword
}, 300)
</script>
<h1 style="font-family: sans-serif;margin-bottom: 5px;"> Searching <!--KEYWORD--> </h1>
<img style="width: 80%; margin: auto;margin-top: 0px;" src="./ninja.png" />
</body>
</html>