Compare commits

...

5 Commits

Author SHA1 Message Date
Simon Bruder 6dd68a6406
add vimeo
continuous-integration/drone/push Build is passing Details
2019-05-26 15:39:08 +00:00
Simon Bruder 34cb42d567
add debian man pages 2019-05-26 15:38:44 +00:00
Simon Bruder 068207c341
add debian package search 2019-05-26 15:38:20 +00:00
Simon Bruder 40b43587b2
add github 2019-05-26 15:37:07 +00:00
Simon Bruder 86522cc0d6
add user script 2019-05-26 15:36:15 +00:00
2 changed files with 47 additions and 1 deletions

View File

@ -2,8 +2,9 @@
wde: https://de.wikipedia.org/w/index.php?search=%s
wen: https://en.wikipedia.org/wiki/Special:Search?search=%s
# Youtube
# Video
yt: https://www.youtube.com/results?search_query=%s
vimeo: https://vimeo.com/search?q=%s
# Dictionaries
jisho: https://jisho.org/search/%s
@ -11,3 +12,10 @@ lide: https://de.linguee.com/deutsch-englisch/search?query=%s
# Package search
alpine: https://pkgs.alpinelinux.org/packages?name=%s&arch=x86_64
apt: https://packages.debian.org/search?keywords=%s
# GitHub
gh: https://github.com/search?q=%s
# Man pages
man: https://dyn.manpages.debian.org/jump?q=%s

38
startpage.user.js Normal file
View File

@ -0,0 +1,38 @@
// ==UserScript==
// @name Startpage Bangs
// @version 1
// @grant none
// @run-at document-start
// @include https://*.startpage.com/*
// ==/UserScript==
fetch('https://s3.sbruder.de/cdn/bangs/bangs.json')
.then(text => text.json())
.then(bangs => {
const urlParams = new URLSearchParams(window.location.search)
const searchQuery = urlParams.get('query')
let matchBang = null
let parsedBang = null
matchBang = searchQuery.match(/(.*) \!(.*)/)
if (matchBang !== null) {
parsedBang = {
'bang': matchBang[2],
'query': matchBang[1]
}
}
matchBang = searchQuery.match(/\!(.*) (.*)/)
if (matchBang !== null) {
parsedBang = {
'bang': matchBang[1],
'query': matchBang[2]
}
}
if (parsedBang !== null) {
redirectURL = bangs[parsedBang.bang].replace('%s', parsedBang.query)
window.location.replace(redirectURL);
}
})