Skip to content

Commit

Permalink
prevent ampersand sign from meaningful to google search url
Browse files Browse the repository at this point in the history
  • Loading branch information
kyupark committed Sep 16, 2012
1 parent 4855195 commit ca70625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ For markdown on tumblr, when em or li used, feeling-lucky it on youtube. 'artist

For example,

_Matisyahu's Sunshine_ was playing at the Apple Store.
Watch *Apple iPhone 5 Keynote*

iTunes Top 3 Songs September 15
iTunes Top 3 Songs - September 15, 2012
+ PSY - Gangnam Style
+ We Are Never Getting Back Together
+ Maroon 5 - One More Night

Feeling lucky on any website
-----------------------------
When strong used, just feeling-lucky it.
**John Gruber** writes **Daring Fireball**.
**Apple Online Store**
__Amazon__



2 changes: 1 addition & 1 deletion lucky.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function lucky(it,site) {
var url = 'http://www.google.com/search?btnI&q=';
site = (typeof site === "undefined") ? "" : "+site:" + site;
var text = String(it.text()).split('-').join('').split(' ').join('+');
var text = String(it.text()).split('-').join('').split('&').join('').split(' ').join('+');
url = url + text;
it.html('<a target="_blank" title="Listen to ' + it.text() +' on YouTube" href="' + url + site + '">' + it.text() + '</a>');
}
Expand Down

0 comments on commit ca70625

Please sign in to comment.