You need at least Tasker version 5.4.6b for this profile to work (you might need to join the beta) and you can also directly import this profile from here.
In this project you'll learn how you can replace the old FsIntents app with the new AutoWeb app and the Foursquare API.
STEP 1 - IMPORT API AND CHECK IN WITH LOCATION
%par1 is the first parameter that this task will receive. This variable is used instead of a concrete value so that this task can be used to check-in to any Foursquare venue, depending on the parameter that is sent to this task from other places. You'll see a few examples up ahead.
- Open AutoWeb
- Select Browse Web Services
- Import the Foursquare API (you may need to authenticate)
- In Tasker create a new task called Check In Foursquare
- Add an AutoWeb Web Service action
- Select the Foursquare API and the Check-In API action
- Set the Venue Id to %par1
- Notice how Latitude and longitude is set to %LOCN. This will use Tasker's last known location
This output will contain the phrase that you normally get in Foursquare when you check-in to a venue. Something like Congratulations, you got 5 points for this check in! or something like that. It'll be available in the task as a Tasker variable.
- Set optional Shout and Broadcast values
- In Output -> Fields to Get select Points Message
- Accept the action and add a Get Location action as the first step in the task.
- Set Source to Net (this will update the %LOCN variable used above)
STEP 2 - DIRECT VENUE CHECK IN
- Create a new task called Check In Statue of Liberty
- Add a Perform Task action and select the previously created Check In Foursquare task
- We'll now need the value to pass in as a parameter. Let's get that from the Foursquare website
- Open foursquare.com and search for the venue you want to check-in to
- Copy the last part of the URL: that's the venue's ID
- Paste it in the Parameter 1 field in Tasker as shown in the video
- Go back to the Check In Foursquare and add a Flash action to the end of the task to show what %points_message1 contains (forgot to do that before). This will show whatever message foursquare outputs from your check-in as a short toast on your screen
- Back out of Tasker to save
STEP 3 - TESTING CHECK IN
If you go back in Tasker and run the Check In Statue of Liberty task, you'll get a toast with the result shortly thereafter.
If Foursquare thinks your check-in is invalid (like the one in the video), it'll not respond with a message and you'll see the result in the video.
STEP 4 - CHECK IN A NEARBY VENUE
If you set this to %LOCN don't forget to first update your location with the Get Location action.
- Create a new task called Check In Near
- Add an AutoWeb Web Service action
- Select the Foursquare API and the Search Venues API action
- Set Latitude and Longitude to %LOCN (or to a specific place, like I did in the video)
%name() and %venueid() are the values we got from the Search Venues API call above. We're using them as inputs in this dialog so we can select one of them.
- Add Venues Id and Venues Name to the output
- Accept and add an AutoTools Dialog action
- Set Dialog Type to List
- Set a title like Checking in...
- Set Texts to %name()
- Set Commands to %venueid()
- Under Advanced, enable Close On Select
- Accept and add a Flash with %atcommand action just to confirm that we're getting a correct venue Id from the selection
STEP 5 - TESTING DIALOG
If you now run the task you can select a nearby venue from a dialog and see that a venue Id is selected.
STEP 6 - CHECKING IN WITH DIALOG
All that's left is to add a Perform Task action and setting the Parameter 1 field to %atcommand (which is the selected Venue Id).
Running the task now will check you in to the venue you select in the dialog!
STEP 7 - AUTOMATIC CHECK INS
You can now use the Check In Foursquare task to check in depending on your condition!
For example, create a profile with the WiFi Connected condition and in the task check in to your work venue!
With AutoWeb you can now very easily check in to Foursquare on demand and automatically!