Read The Bleepin’ Manual
Wi-Fi Wizardry & Other Tubes
Setting Internet settings ain’t exactly a walk in the park, but ZOMG, if you do it right, you can search the whole bleepin’ Internet without leaving the app! OnSong can’t hand you these settings, because you have to personally promise to play nice with that web site’s terms of use (yeah, we know you didn’t read them, amirite?). Leave these fields blank & the in-app Internet search just sits there doin’ nothin’, so you’ll have to use the Add To OnSong Safari Extension instead. Sad trombone.
Note: OnSong uses a pattern-oriented programming language called Regular Expressions to figure out what to import. Written right, these random-lookin’ strings of characters become magical patterns that yank text right out of a web page. Written wrong, they become a cry for help. Regular Expressions are used in all the pattern properties below. Good luck, peeps.
You can configure OnSong to search different websites using the following fields (brace yourself):
Search Parameters
OnSong uses Microsoft Bing to search for content on the Internet. Yep, Bing. Someone has to use it. Your search query goes straight to the search engine, but you can sneak in extra parameters here, like which domain to search. This example limits the search to the chords directory of one specific website:
site:http://www.domain.com/chords
Learn more about advanced Bing search parameters (because you clearly have free time)
Title Pattern
The title pattern gets run against the title attribute of the page content it finds & grabs the song title. This example yanks Brown Eyed Girl out of the full web page title, Brown Eyed Girl By Van Morrison. Magic? Nope. Just regex. Srsly.
(.+?)(?=(( +Chords)|( +By)))
Byline Pattern
The byline pattern also runs against the title attribute of the found page content & snags the byline, a.k.a. the artist. This example plucks Van Morrision out of the full web page title, Brown Eyed Girl - Van Morrison. (Yes, we spelled it wrong. Yes, we’re leaving it. Don’t @ us.)
(?<=[\-])(.+?)(?=\|+\s*)
Content Pattern
The content pattern pulls the actual song out of the full HTML mess that is a web page. Usually the good stuff hides inside HTML <pre></pre> tags. This example grabs whatever lives in the pre elements of the page it found. NOM NOM NOM.
(?<=<pre>)(.+?)(?=</pre>)
Chord Pattern
Sometimes web sites mark up chords with HTML, because of course they do. OnSong can hunt down those chords with a regular expression too. In this example, HTML <u></u> tags mark the chords. The pattern below rips those out & turns them into nice bracketed chords. You’re welcome.
<u>(.+?)</u>
Chord Style
When OnSong finds content, it might be bracketed, or it might be plain text with chords floating over lyrics. Tell OnSong what that web site is serving up right here. For example, pick bracketed, use the previous chord pattern, & the chords it finds get wrapped in square brackets. Easy peasy, lemon squeezy.
Strip HTML Tags
Most chord charts on the web are plain text inside <pre></pre> tags, but sometimes they come with a bunch of junk HTML tags tagging along for the ride. Flip this on to ditch that extra garbage. Default is off, because we like to live dangerously.