So, this is a command that I have fun with when I'm bored. It's kind of a 'serendipitous discovery' tool for the virtual tourist, but you could also use it practically.
The basic idea is: "Four Square, find popular X in [city] Y." Phrasing of your choosing, natch.
Look up microbreweries, museums, sushi joints -- whatever makes sense in the Four Square context.
VC scrapes Four Square and provides the top-rated Four Square results for destinations that I might want to check out. It then asks if I want to see the Four Square map to find out more. Usually I do.
I happen to like libraries. This morning I was introduced to the
Canada Water Library in south-east London via my whimsical Four Square query ("Find popular libraries in London"), after which I looked up the history of the Canada Water district etc. Neat discovery for a Canadian!
If this sounds
incredibly lame and uninteresting to you, try asking your better halves what they want to look up in the fantasy destinations of their choice, and then give the old Four Square command a go.
For this command:
I'm using two payload lists in order to improve recognition. You could also use payloadXML of course. In my case, I should probably do that because there's a character limit on payload lists, so I can't include all the cities I might be interested in. This is the kind of thing where you'd want to customize the lists to your own interests (within limits of Four Square's likely content).
I also cloned the command and created a new group, in which I swapped in payload dictation for the payload lists, but I gave that group a lower priority. This means that VC first tries to listen for recognizable payloads from my prioritized command that relies on the lists, and only if it fails at that will it try the free dictation route.
You can change a group's priority by right-clicking on the group's icon and editing its properties:
http://voxcommando.com/mediawiki/index.php?title=Groups#Group_PropertiesBelow is the xml for just the prioritized Four Square group (because I'm lazy).
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.1-->
<commandGroup open="True" name="FourSquare" enabled="True" prefix="" priority="3" requiredProcess="" description="">
<command id="481" name="Open four square" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.OpenURL</cmdType>
<params>
<param>{Var.FourSquare}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Open four square</phrase>
</command>
<command id="490" name="Scrape" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>FourSquare</param>
<param>https://foursquare.com/explore?mode=url&near={2}&q={1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Map.CreateTable</cmdType>
<params>
<param>FS_TopResults</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Scrape</cmdType>
<params>
<param>https://foursquare.com/explore?mode=url&near={2}&q={1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>class="venueName">.*?<a.*?>(.*?)</a</param>
<param>. </param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Map.Set</cmdType>
<params>
<param>FS_TopResults</param>
<param>{i}</param>
<param>{Match.{i}}, {2}</param>
</params>
<cmdRepeat>5</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>class="venueName">.*?<a.*?>(.*?)</a>.*?venueScore.*?title\="(.*?)\"></param>
<param>. </param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.MatchConcat</cmdType>
<params>
<param>.{CR}</param>
<param>3</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.Replace</cmdType>
<params>
<param> - People</param>
<param> people</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.Replace</cmdType>
<params>
<param>&#39;</param>
<param>'</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.Replace</cmdType>
<params>
<param>&amp;</param>
<param>and</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.Replace</cmdType>
<params>
<param>/</param>
<param> out of </param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Top results: {CR}{LastResult}.</param>
<param>10000</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>The top Four Square results were: {LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<params>
<param>Would you like to see these on the Foursquare map?</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TellVox</cmdType>
<params>
<param>Open four square</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Four Square</phrase>
<phrase>Find popular, Find me, Name some, Give me some</phrase>
<payloadList>restaurants,libraries,museums,pubs,microbreweries,pool halls,billiard joints,brunch joints,cafés,Thai food,Indian food,Chinese food,Italian food,French food,food,sushi,pizza,vegetarian restaurants</payloadList>
<phrase optional="true">in</phrase>
<payloadList>Amsterdam, Berlin, Brussels, Budapest,Chennai, Chicago, Copenhagen, Delhi, Edinburgh, Frankfurt, Geneva, Glasgow, Hong Kong, London, Manchester, Marseille, Montreal, Moscow, Mumbai, Munich, NYC, Oslo, Paris, Prague,San Francisco,Stockholm, Tokyo, Toronto, Van</payloadList>
</command>
<command id="626" name="Find out more" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Map.Get</cmdType>
<params>
<param>FS_TopResults</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenURL</cmdType>
<params>
<param>http://www.google.com/search?q={LastResult}&btnI</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Tell me more about, Find out more about, Google</phrase>
<phrase>Four Square result number</phrase>
<payloadRange>1,5</payloadRange>
</command>
</commandGroup>
cheers
EDIT: I've updated this command group to include a new "Find out more" command. You can now do a Google lucky search for any of the top Four Square results. This uses VC's nifty maps feature.
http://voxcommando.com/mediawiki/index.php?title=MapsMay 2014 edit: The Four Square site's html has changed since my initial post. I've updated the regex in the XML of the Scrape command above, so it should work again. This is something you may have to do periodically. If you're having trouble figuring out the regular expression pattern yourself, feel free to ask for help.