Friday, February 27, 2015

iOS Automation - Importing Daily Notes to Day One as one entry

I've been trying to think of a way to use my diary app (Day One) a little more often. Usually I find that I either don't have time or I'm too tired to summarize the day before bed.

One idea that I had was to submit bite-sized entries as the day wore on. The shorter the update, the less of a burden it would be to write it and the more likely that an entry would happen.

I chose Day One as it's one of the most popular diary apps on iOS and it supports URL schemes (more on this later...) 

The approach that most people would take would be to launch the Day One app, open a new entry... add notes... save... repeat... This works but it would end up creating multiple entries for that day. I was hoping to only have one for the day. The other approach would be to open the relevant entry and keep adding to it but I was hoping to add a timestamp of when I added each comment. To do this, I would have to type in the date and time manually before adding each entry. Sounds like a job for automation!

So I turned to iOS automation using a combination of the following workflow-based applications:
  1. Launch Center Pro: This app is used as a central place to go to open other iOS apps and run various actions using URL schemes.
  2. Workflow: This app takes advantage of iOS 8's sharesheets, with the new ability to send data from one app to another.
  3. IF (formerly known as IFTTT): This app connects cloud based services with actions local to the phone. It is possible to connect IF with Launch Center Pro (LCP) and run LCP actions from IF.
  4. Drafts 4.0: This app is a note taking app that support actions. These actions support URL schemes and Javascript.
The goal was to prompt me for text, prepend a timestamp to it, add it to a text based note and at the end of the day, automatically send it to Day One and clear the note for the next day.

I must warn you that the following automated workflows may appear to be more convoluted than necessary. I'm sure that there are better ways to accomplish the same thing. This is how I chose to do it.

1) Appending a date and text to a Drafts 4.0 note


Launch Center Pro's action

This URL scheme will prompt you for text, send the text to Workflow, run the "Append to Drafts with Date" workflow and return to Launch Center Pro at the end.
  • launch://x-callback-url/clipboard?text=[prompt-return:Text]&x-success={{workflow://run-workflow?name=Append%20to%20Drafts%20With%20Date&x-source={{Launch Center Pro}}&x-success={{launch://}}}}

Workflow's "Append to Drafts With Date" workflow

Unfortunately, Launch Centre Pro doesn't have the capability to add a timestamp so I had to rely on Workflow instead. I hear that it may be possible with TextExpander but I chose to use this method instead.
  1. Get Clipboard
  2. Set Variable
    • Variable: Text
  3. Date
    • Use: Current Date
  4. Format Date
    • Date Format: Short
    • Time Format: Short
  5. Set Variable
    • Variable: Date
  6. Get Variable
    • Variable: Text
  7. Add to Variable
    • Variable: Date
  8. Combine Text
    • Separator: Custom
    • Custom:  :
  9. Add to Draft
    • Mode: Append
    • Draft UUID: ################
    • Edit in Drafts: Off
    • Run Action: Off
This will append an entry to a Drafts 4.0 note prefixed with "YYYY-MM-DD: "

The idea would be run the Launch Center Pro action whenever I wanted to record a bite-sized entry.

2) Scheduling a Task in iOS


It turns out that it is not possible to schedule a task to run at a specific time on its own. The best solution that I was able to come up with was to use IF (formerly known as IFTTT) to send a notification at a specific time which when opened would trigger the relevant action.

If you know of any other way of scheduling a task, please let me know.

3) Sending Content to Day One




First we start with an action from the IF app.

If the time of day is 11:15pm then run a Launch Center Pro action. In order to run LCP actions from IF, you need to set up a Launch Center Pro account and link it to IF.

IF's Recipe:


  • Trigger:
    • Every day at
    • Time: 11:15pm
  • Action:
    • Run custom URL
    • Which device? (select the relevant iOS device)
    • Custom URL:
      • workflow://x-callback-url/run-workflow?name=Send%20Content%20To%20Day%20One&x-source=((Launch Center Pro))&x-success=((launch://))
  • Notification:
    • Push to Day One?
  • Sound:
    • None

Workflow's "Send Content To Day One" workflow


  1. Get Contents of Draft
    • Draft UUID: ################
  2. Set Variable
    • Variable: Content
  3. Get Variable
    • Variable: Content
  4. Count
    • Count: Characters
  5. Calculate
    • Operation: /   (divided by)
    • Operand: 3.142
  6. If
    • Input: Contains
    • Value: .
  7. Open Draft
    • Draft UUID: ##############
    • Edit in Drafts: Off
    • Run Action: On
    • Action: Export To Day One
    • Key: (Leave blank)
    • After Success: Nothing
  8. Otherwise
    • Vibrate Device
  9. End If

Drafts 4.0 "Export To Day One" Action


  • Steps: 
    • 1 step: URL
      • Description: Open a URL
      • URL Template: 
        • dayone://post?entry=[[draft]]
  • Action Groups:
    • 0 groups
  • Description:
    • Send draft to Day One as a journal entry
  • Advanced:
    • Confirm before running: Off
    • After Success: Default
    • Log level: Errors

4) Clearing the Drafts Note after Content Has Been Sent To Day One



Unfortunately, it's not possible to include this function in the previous step because Day One does not support x-callback-url URL schemes. These allow you to launch another application, perform and function then then return to the original or another application. Without it, the previous action will open Day One and add the content to a diary entry. The edit window in Day One would remain visible instead of returning to the application that launched the initial request.

If the time of day is 11:30pm then run a Launch Center Pro action.

IF's Recipe:


  • Trigger:
    • Every day at
    • Time: 11:30pm
  • Action:
    • Run custom URL
    • Which device? (select the relevant iOS device)
    • Custom URL:
      • workflow://x-callback-url/run-workflow?name=Remove%20Drafts%20Content&x-source=((Launch Center Pro))&x-success=((launch://))
  • Notification:
    • Remove Drafts Content?
  • Sound:
    • None

Workflow's "Send Content To Day One" workflow


  1. Get Contents of Draft
    • Draft UUID: ################
  2. Set Variable
    • Variable: Content
  3. Copy To Clipboard
  4. Get Variable
    • Variable: Content
  5. Count
    • Count: Characters
  6. Calculate
    • Operation: /   (divided by)
    • Operand: 3.142
  7. If
    • Input: Contains
    • Value: .
  8. Open Draft
    • Draft UUID: ##############
    • Edit in Drafts: Off
    • Run Action: On
    • Action: Remove All Text
    • Key: (Leave blank)
    • After Success: Nothing
  9. Otherwise
    • Vibrate Device
  10. End If

Drafts 4.0 "Remove All Text" Action


  • Steps: 
    • 1 step: Script
      • Description: Run JavaScript
      • Script: 
        • var sel = draft.content;
          draft.content = "";
          commit(draft);
  • Action Groups:
    • 0 groups
  • Description:
    • Remove all lines from your Draft
  • Advanced:
    • Confirm before running: Off
    • After Success: Default
    • Log level: Errors

Conclusion


Although it is a little convoluted, this workflow ends up working quite well for me.

Some of the things that I learned during this experiment:

  1. You cannot schedule an automated tasks on a non-jailbroken iPhone without manual intervention.
  2. To schedule an automated task, you will need to use IF (aka IFTTT) and Launch Center Pro. A Launch Center Connect account is required (no additional cost and initiated within the LCP app itself.)
  3. It is possible to add a timestamp and delimiter using Workflow. TextExpander also works apparently but I haven't tried it out.
  4. Day One doesn't support x-callback-url URL schemes. This means that you cannot chain actions together. Without support for it, the action sequence will always end at Day One. I have contacted their support team and have put in an request for this.
  5. IF recipes are typically triggered a few minutes after I specify.
  6. You can only modify text using Javascript in Draft 4.0. The built in options in Workflow and LCP don't allow you to modify content, only add to it.
  7. It is possible to check for content in a variable using Workflow but the process is not very straight-forward. 
That's all for now. Let me know if you have any better ways of going about all of this.


Wednesday, February 4, 2015

The Weightloss Workaround

I've discovered a secret... a way to magically lose a pound or two within 15 minutes.



All it takes is to have a hot shower. It doesn't always work and may be more prevalent in the winter when it's cold in the bathroom but I have repeatedly weighed myself before and after a hot shower and typically lose 1 - 2 pounds.

Your mass doesn't really change from taking a shower. It may even increase due to absorbing water but your weight will generally go down. This is because heat rises causing an updraft around your body, tricking the scale into reducing your weight.



If you track your weight daily, this would be the best time to weigh yourself. :)



Note that if the temperature in the room is close to your body temperature after the hot shower, you may not notice much of a difference but give it a shot and start feeling ten times better everyday!


Other weight-loss workaround tips:
  1. Always weigh yourself right after you get out of bed in the morning. This seems to be when you weigh the least.
  2. Go to the bathroom before you weigh yourself. This sometimes helps.
  3. Don't wear any clothes when weighing yourself.
  4. Weigh yourself before eating any food.
  5. Have your hot shower right after you wake up and then weigh yourself.

Thursday, January 22, 2015

The Devolution of EA's NHL Series

 
The NHL video game series has been a love of mine for as long as it has been out. It has always been the one game that I could pick up and play at any time - a quick game here and there. When I got an XBOX 360 back in 2007, my online gaming quickly ramped up. The introduction of the EA Sports Hockey League is what made the game for me - allowing you to build you're own player and earn attributes as you play games and earn achievements.


NameLast PlayedGamerscoreDays played at least once
NHL® 14 12/21/2014 1:03:07 PM 165/1000 (17%) 206 days
NHL® 12 09/08/2012 23:35 235/1000 (24%) 196 days
NHL® 11 09/12/2011 0:04 430/1000 (43%) 172 days
NHL® 13 09/06/2013 23:15 315/1000 (32%) 159 days
NHL® 09 09/09/2009 23:12 420/1000 (42%) 157 days
NHL® 10 8/21/2010 12:07:10 AM 515/1000 (52%) 116 days
NHL® 08 03/06/2009 0:04 75/1000 (8%) 72 days
NHL® 07 8/22/2007 7:15:31 PM 1000/1000 (100%) Don't have accurate # of days but achieved 1000 gamerscore
Then came NHL 15... I was initially quite excited about it. It would the first game on the new generation of consoles. It would give me a reason to buy an XBOX One. NHL 14 wasn't released on the new console despite being a good candidate for the new console, giving the devs an extra year to work out the quirks of the XBOX One. NHL 15 was certainly hyped over the course of the year and excitement turned to worry which turned to dread as news finally game out right before release that NHL 15 would be missing most of the modes that made the game fun (at least for me.) Initially, I didn't get NHL 15 because there was no online league component. There was however a promise of a makeshift online play option (minus goalie control.) In the end, I bought an XBOX One with a deal that included a free game. I chose NHL 15 as I didn't want to pay for it. Still... I had hope that I would still be drawn into the game. After a number of months, here's where I stand with NHL 15:

NHL® 15 10/05/2014 30/1000 (3%) 2 hours

Please EA... I beg of you. Do not make the same mistake and leave out key pieces of the game that keep gamers interested. Without the online league component, the addiction was no longer there. On the one hand, it gave me back some of my life and sleep but I do miss the fun times.

Sunday, January 4, 2015

Recommended iPhone Apps - Jan 2015

I am quite a collector of iOS apps, having a few hundred (569) apps on my phone. Some may call this obsessive but I blame it on an app called "AppsGoneFree" which I have checked every day for the last couple years. Most of these apps linger on my phone, going untouched as I don't have time to go through them all but there are many, many apps that I use on a daily basis. I thought I'd share some of my favourites. A number of these are paid apps and in most cases, worth it. You get what you pay for in many cases. There are also many excellent free apps in this list too. I've left out some of the more popular ones such as Facebook, Flixter, Shazam, Yelp, Evernote, etc...

Must Haves (in my opinion):

  1. Launch Center Pro: Quick launch app that allows you to code actions using URL schemes. It allows for integration with other apps. I use it to group contacts (includes dialing), bookmarks, search queries for numerous sites, posting to twitter and facebook at the same time, launching Waze with my home or work address, saving photos to Dropbox, etc...
  2. Fantastical 2: This calendaring app has replaced the default iOS calendaring app for me and it integrates with Launch Centre Pro. It also has an awesome Today widget.
  3. Tweetbot: This is a popular alternative to the default Twitter client. It will probably eventually die as Twitter stops supporting its API but it still is one of the better apps I've tried, saving your place on your timeline and having the ability to create lists, etc...
  4. Reeder: I use this to catch up on website articles. It's an RSS reader with gesture support. I use this daily and it supports Readability to display the whole article without ads. It used to hook up with Google Reader but works with Feedly's online RSS reader service too. It makes RSS reading very fast.
  5. Appsgonefree: Paid apps that go free that day are posted in this app. These are curated and include apps with 3 star or higher ratings. Typically there are about 5 - 10 apps listed per day so it's not overwhelming like some of the other apps like this. I think Apple removed this app from their App Store... The daily posts are still available on the AppAdvice website.
  6. 1PasswordGreat for keeping track of all your passwords and works with iOS extensions in iOS 8 so you don't need to use the browser within the application anymore. It also allows you to wirelessly synch your passwords on the same network if you don't want to store your passwords in the cloud.
  7. Pocket: This is to capture articles to read later. I use this a lot but I find that I have a hard time finding time to revisit these articles but at least they are there for future reference.
  8. My Forecasts: Your WeatherThis is my favourite weather app so far. It shows temperature, precipitation, visibility, wind, etc in hourly line and bar graph format. Rotate your phone to get the traditional weekly forcast. It also has a Today widget which is really nice.
  9. Clips: This app has a Today widget that will show you your latest clipboard items. It stores your clipboard history (can be customized). It's really nice having this as a widget as you don't have to leave the app you're in. It also has a keyboard but it doesn't need to be used for the widget to work.
  10. Threes!: I am so addicted to this game. Worth the $ in my opinion.
  11. Emoji++: This is a keyboard that displays all emojis in a vertical scrolling list. I can never go back to the original Emoji keyboard.

Nice to Haves

  1. Day One: This is one of the better diary apps that I've seen. It integrates with Launch Center Pro which is really nice.
  2. Musixmatch: This has a Today widget that will display the lyrics to the song you're listening to and follow along with it. Pretty neat.
  3. Drafts: A really flexible note taking app that supports workflow and integrates well with other apps (Launch Centre Pro, etc...) It also has a really useful Today widget which shows you your most recent notes.
  4. Workflow: This is a new app that looks really cool. I haven't had a chance to play with it but it can do some really cool things such as make a pdf out of any page, speak text on the screen, find lyrics to any song, shorten URLs, append to Evernote, and so much more.
  5. IFTTT (If This Then That): This is another workflow app that is also in the cloud. You can do things like send a notification to you at 7:00am with today's weather or if you take a picture, upload it to Dropbox or if the Canucks score then send a notification.
  6. Instacast: I use this to listen to podcasts. I like being able to speed up the audio (x2) without affecting the pitch. I've heard Overcast is also good. I'll be checking that out soon too.
  7. Radar: Show you where the Translink buses are in real-time.
  8. Transit App: So much better than the Translink app. Allows you to map out your route on a map and shows you multiple options. It also automatically shows the nearest bus stops.
  9. tinyCalc: This is a calculator that is a Today widget. Helpful when you don't want to leave your app to calculate something. E.g. The RBC app logs you out when you leave their app but now I don't need to leave the app.
  10. Vert: This unit converter does what many others do not - convert into feet and inches. Most other apps will display feet with decimals after it.
  11. Paint Tester: This is a cool app that lets you take a picture of a room and try out different colours on the wall. Works quite well.
  12. Anything After: This app lets you know if there are any extra scenes after or during a movie's credits. I use it every time I go to a movie now.
  13. Occasions+: Helps me keep track of birthdays. One of the few apps that doesn't have to pull data from Facebook and other online services. I prefer to keep that data local.
  14. Crossy Road: This is an addictive game that is reminiscent of frogger but it includes tons of playable characters with their own themes/animations. Check it out.
  15. Ticket to Ride Pocket (USA and Europe): Both games are really good renditions of the board game and supports pass and play, over wifi, solo, etc...
  16. Emojimo: This is a keyboard that will attempt to convert your messages to emojis automatically as you type. Not sure if I'll use it much but it's kind of fun.
More info about some of these apps can be found here if you're interested: http://www.macstories.net/roundups/my-must-have-iphone-apps-2014-edition/
This is what inspired me to create my own list.

I'm sure I've missed a few but it's a start. If anyone has discovered any cool apps, please respond to this post and share. I'm currently on the lookout for the ultimate To Do list app. I've tried quite a few and still haven't found one that sticks. I'm also looking for a replacement Music app. I'm also looking to replace iTV shows which I use to keep track of what I'm watching on TV but I find that it's a little flaky and loses its place sometimes. Let me know if you have any suggestions.

Monday, August 24, 2009

Thursday, June 11, 2009

Thursday, January 8, 2009

Mats Sundin and Nike Commercials Revisited

Mats Sundin played his first game in a Canucks uniform. I guess it will take a few games for him to get up to speed.

I'd rather see Demitra and Wellwood on the Sundin line and Raymond moved up to the Sedin line. Time will tell what combinations click. At least the Canucks won the game...

All this Sundin talk reminded me of the old Nike Goalie commercials. They were awesome... "Poke Check!" :)

I thought it would be nice to revisit the series of commercials while I had it on my mind. These brought back some great memories... Here they are:

The Gardener (Mats Sundin):



The Cabbie (Mats Sundin):



Dial-a-Psychic (Mats Sundin):



ABBA (Mats Sundin):



The Babysitter (Theo Fleury):



The Janitor (Sergei Federov):



Burgerama (Sergei Federov):



The Phonebooth (Sergei Federov):



The Bus Stop (Sergei Federov):



Pan Handler (Jeremy Roenick):



Bank Robbery (Rod BrindAmour):



Banana:



Shaving Cream:

Wednesday, January 7, 2009

Hockey Hilarity

I don't think I need to say much... Just watch and enjoy.

Rangers Sasson Jeans Commercial:



Rangers Sasson Jeans Commercial - The Sequel:



Those Red Hot Flames:



Gilles Meloche Pizza Commercial: