I use YouVersion's Bible app on a daily basis. It's the first app I open every morning. I usually end my Bible reading session by picking out a verse that hits home for me. Then, I store it in Momento, and cross-share it to Facebook and Twitter via Path.
As I was reading through Ben Tsai's website, I stumbled upon his post about YouVersion's Bible app URL Scheme. I didn't know that the app has any URL Scheme beyond the one shown in Launch Center Pro:
Ben wrote about several undocumented URL Schemes that the app supports:
I was really excited with the possibility of storing/sharing a verse with a URL Scheme that could redirect me back straight to the verse. But, before I got to work, I realised that the app uses OSIS Book Abbreviations that requires me to have a Map/Dictionary stored somewhere for runtime lookup.
Converting the References to URL Schemes
YouVersion's Bible app allows you to select one or more verses within a single chapter, and put them into the clipboard. Here's an example of what the clipboard looks like if you select a single verse:
Guard your heart above all else, for it determines the course of your life. (Proverbs 4:23 NLT)
The first thing that came to mind was grabbing the
(Proverbs 4:23 NLT) part using regular expression. I was using Patterns on the Mac and TextTool on iOS to tinker with it. Craig Pearlman, TextTool's developer, even helped me with my inadequate regular expression skills. But, I decided to go with Pythonista because I would need to convert the OSIS code too.