Code Wizards
Yeet Into OnSong
The Add To OnSong extension lets peeps grab music from your website by tapping share & action extensions in iOS. OnSong might even import stuff through an in-app browser. LOL, fancy. As a website owner, YOU’RE the boss of what gets imported & whether anyone gets to import at all. Power trip!
How This Sorcery Works
To figure out what to import, OnSong snoops around your website for the good stuff. It’s not stalking. It’s “reviewing.”
- Dig through the
<input type="hidden"/>elements until we find real ChordPro. We believe in you. Kinda. - No luck? We line up the
preelements & crown whichever one rambles on the longest. Winner! - Whatever we find gets scrubbed of HTML tags, so no fancy formatting. Boring? Yes. Clean? Totes.
- We snag the last
h1tag with just text & call it the filename. Genius or lazy? Both. - Can’t find it? We just grab the filename off the end of the URL. Not our best work, LOL.
Found the goods? ZOMG! We save ’em to a file with the found name & import it in its native format. If the title’s missing, we stick it on there. You’re welcome, ya mess.
Make Your Stuff Suck Less
Want your peeps to get the best bleepin’ content when they use the Add To OnSong Safari extension? Listen up, buttercup:
- Add or tweak an
<input type="hidden"/>element with ChordPro in it.
OnSong will ALWAYS pick this overpretags. We’re playin’ favorites. - Double check that the goods inside pre tags are in OnSong or ChordPro format. Not “whatever.” Not “vibes.” Actual formats.
- Make sure you set legit restrictions on your file using the restrictions metadata tag. Don’t make us come over there.
Keepin’ the Riffraff Out
Don’t want OnSong poking around your stuff? Try these. We won’t be offended. (We will.)
- Gimme an
<input type="hidden"/>element with ChordPro & a title. That’s it. Don’t overthink it, amirite? - Do NOT toss in
<input type="hidden"/>elements full of ChordPro orpretags. Srsly. We said no. - Use Javascript to render your chord charts so nobody (or no bot) can grab ’em. Sneaky sneaky. NOM NOM.