Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Mar 12, 2013
0 parents commit 4cdc259
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
Binary file added Pinadd/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions Pinadd/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>action</key>
<false/>
<key>category</key>
<string>SCRIPTS</string>
<key>command</key>
<string>#!/bin/bash
# Set your API Token here (get it at "https://pinboard.in/settings/password")
token=""
# Set your prefered browser (comment with a "#" the one you do not want to use)
browser="Google Chrome"
#browser="Safari"
# Get browser's frontmost tab's url and title, and set the tags for Pinboard
# Arguments must be url-encoded (hence the 'perl')
if [[ ${browser} == "Google Chrome" ]]; then
url=$(osascript -e 'tell application "Google Chrome" to return URL of active tab of front window' | perl -MURI::Escape -wlne 'print uri_escape ($_)')
title=$(osascript -e 'tell application "Google Chrome" to return title of active tab of front window' | perl -MURI::Escape -wlne 'print uri_escape ($_)')
elif [[ ${browser} == "Safari" ]]; then
url=$(osascript -e 'tell application "Safari" to return URL of front document' | perl -MURI::Escape -wlne 'print uri_escape ($_)')
title=$(osascript -e 'tell application "Safari" to return name of front document' | perl -MURI::Escape -wlne 'print uri_escape ($_)')
fi
tags=$(echo {query} | perl -MURI::Escape -wlne 'print uri_escape ($_)')
# Add the bookmark
curl --silent "https://api.pinboard.in/v1/posts/add?url=${url}&amp;description=${title}&amp;tags=${tags}&amp;auth_token=${token}"</string>
<key>disabled</key>
<false/>
<key>escapedollar</key>
<false/>
<key>escapequery</key>
<false/>
<key>escapequerybackquotes</key>
<false/>
<key>escapequerybrackets</key>
<false/>
<key>escapequeryquotes</key>
<false/>
<key>escapequerysemicolons</key>
<false/>
<key>growloutput</key>
<true/>
<key>growloutputsticky</key>
<false/>
<key>keyword</key>
<string>pin</string>
<key>logging</key>
<false/>
<key>multifileargs</key>
<false/>
<key>parameter</key>
<integer>2</integer>
<key>silent</key>
<true/>
<key>subtitle</key>
<string>Takes arguments as tags — adds your browser's frontmost tab as a pinboard bookmark</string>
<key>title</key>
<string>Pinadd</string>
</dict>
</plist>
10 changes: 10 additions & 0 deletions Pinadd/kudos.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>creator</key>
<string>Vítor Galvão</string>
<key>website</key>
<string>http://vitorgalvao.com/</string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Collection of Alfred Extension scripts

### Pinadd
Takes arguments as tags, and adds your browser's (Safari or Chrome) frontmost tab as a pinboard bookmark.
(You need to add your Pinboard's API Token (get it at "https://pinboard.in/settings/password") on the line that says “token=""”)
(If you use Safari instead of Chrome, you need to change that option in the script by commenting the respective line. More instructions on the extension itself)

### StrongPassword
Get a strong password from https://www.grc.com/passwords.htm directly to the clipboard
Binary file added StrongPassword/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions StrongPassword/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>action</key>
<false/>
<key>category</key>
<string>SCRIPTS</string>
<key>command</key>
<string>#!/bin/bash
curl 'https://www.grc.com/passwords.htm' | grep 'ASCII characters:' | perl -MHTML::Entities -ne 's/.*2&gt;|&lt;.*//g; print decode_entities($_)' | tr -d '\n' | pbcopy
echo "Password copied"</string>
<key>disabled</key>
<false/>
<key>escapedollar</key>
<false/>
<key>escapequery</key>
<false/>
<key>escapequerybackquotes</key>
<false/>
<key>escapequerybrackets</key>
<false/>
<key>escapequeryquotes</key>
<false/>
<key>escapequerysemicolons</key>
<false/>
<key>growloutput</key>
<true/>
<key>growloutputsticky</key>
<false/>
<key>keyword</key>
<string>strongpassword</string>
<key>logging</key>
<false/>
<key>multifileargs</key>
<false/>
<key>parameter</key>
<integer>1</integer>
<key>silent</key>
<true/>
<key>subtitle</key>
<string>Get a strong password from https://www.grc.com/passwords.htm directly to the clipboard</string>
<key>title</key>
<string>StrongPassword</string>
</dict>
</plist>
10 changes: 10 additions & 0 deletions StrongPassword/kudos.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>creator</key>
<string>Vítor Galvão</string>
<key>website</key>
<string>http://vitorgalvao.com/</string>
</dict>
</plist>

0 comments on commit 4cdc259

Please sign in to comment.