Permalink
Browse files

prevent ampersand sign from meaningful to google search url

  • Loading branch information...
1 parent 4855195 commit ca706253729399c11a485a09119d3f07c31af15a @kyupark committed Sep 16, 2012
Showing with 6 additions and 4 deletions.
  1. +5 −3 README.md
  2. +1 −1 lucky.js
View
@@ -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__
+
View
@@ -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>');
}

0 comments on commit ca70625

Please sign in to comment.