Created
March 9, 2012 06:08
-
-
Save Sakurina/2005281 to your computer and use it in GitHub Desktop.
open a foursquare venue from a browser in the iOS app (original src + Closure Compiled bookmarklet)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var a=document.location.pathname.split("/"),b=a.length-1;if(!(0>=b)&&"v"==a["touch"==a[1]?2:1])document.location="foursquare://venue/"+a[b];})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Open foursquare Venue in iOS App | |
var components = document.location.pathname.split("/"); | |
var last = components.length - 1; | |
if (last <= 0) return; | |
var touch = components[1] == "touch"; | |
var checkForV = touch ? 2 : 1; | |
var onVenue = components[checkForV] == "v"; | |
if (!onVenue) return; | |
// Get venue ID | |
var venueID = components[last]; | |
document.location = "foursquare://venue/"+venueID; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment