Frowning-Extinct
View unanswered posts | View active topics It is currently Tue Oct 17, 2017 8:28 pm



Reply to topic  [ 4 posts ] 
New Bandcamp tag 
Author Message
Site Administrator
Site Administrator
User avatar

Joined: Sat Oct 08, 2011 2:14 pm
Posts: 4583
Location: Way down South, UK.
Reply with quote
Post New Bandcamp tag

Okay, since people expressed an interest, there is now a new bandcamp tag available for use on the forum, which will embed a full-size album playlist in your post.

It's a bit of a pain to use, unfortunately, due to the way Bandcamp's embed widget works, so here's a quick guide to what you need.

1. Find the album on Bandcamp and click the Share/Embed option immediately below it.
2. Click the 'Embed this album' link in the window that opens.
3. Click on the leftmost picture in the next window.
4. Right-click and Copy the code in the Embed box.
5. Paste it somewhere (in your forum post, temporarily, for example). It should look like this:
<iframe style="border: 0; width: 350px; height: 470px;" src="https://bandcamp.com/EmbeddedPlayer/album=4256227775/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/transparent=true/" seamless><a href="http://angellore.bandcamp.com/album/la-litanie-des-cendres">La Litanie des Cendres by Angellore</a></iframe>
6. Use the bandcamp tag in your forum post. You need to include the unique ID. In other words,
<iframe style="border: 0; width: 350px; height: 470px;" src="https://bandcamp.com/EmbeddedPlayer/album=4256227775/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/transparent=true/" seamless><a href="http://angellore.bandcamp.com/album/la-litanie-des-cendres">La Litanie des Cendres by Angellore</a></iframe>
7. Your tag should now look like {bandcamp}4256227775{/bandcamp}.
Note: the brackets round the tag will, of course be square [] not curly {}.
8. That's it. If you hit the Preview button, you should see the album displayed like this:

9. If it doesn't show up, double-check your copy-and-paste info. And if all else fails, hope that a friendly moderator will be along at some point to check what's gone wrong :D .

_________________
>> ex silens nox noctis <<


Fri Jan 01, 2016 7:40 pm
Profile
Site Administrator
Site Administrator
User avatar

Joined: Mon Jul 09, 2007 3:39 pm
Posts: 8566
Location: UK
Reply with quote
Post Re: New Bandcamp tag

cheers, Mike... :D

_________________
It's not Doom...


Fri Jan 01, 2016 10:40 pm
Profile
Senior Staff Member
Senior Staff Member
User avatar

Joined: Fri Jun 15, 2007 1:20 pm
Posts: 676
Location: Bradford
Reply with quote
Post Re: New Bandcamp tag

As this is a bit annoying to do, I've made a magic way to do it better...

Tested in Chrome, Firefox and IE11:

1. Create a bookmark/favourite on your bookmarks/favourites bar.
2. Call it 'Get Bandcamp Id' or something (doesn't matter)
3. Paste the following into the Location (in Firefox) or URL (in Chrome and IE) field - (script provided by your trusty staff member and fulltime javascript developer)

Quote:
javascript:(function(){var str = $('#pagedata').data('blob').lo_querystr;%20var%20id%20=%20str.substring(str.indexOf("item_id="),%20str.indexOf("item_id=")%20+%2018).replace("item_id=",%20"");%20prompt("Copy this into a bandcamp tag as follows: [bandcamp]"%20+%20id%20+%20"[/bandcamp]",%20id);})();


Image

4. Now any time you are on a bandcamp album page, click the bookmark. You should be presented with a prompt containing the id.

Image

5. Simply paste the Id into the middle of the bandcamp tag on Doom-Metal.com

Image

6. Sick Tunes Abound


Technical Notes

For the more tech savvy who may be interested in how this works...
All three browsers allow you to create bookmarks containing JavaScript which can be executed against the page you are on. This is a really good way to get malware if you make a link from an untrusted source - its up to you whether I am such a source!
This particular script is very simple: it looks for a particular section of the page source which has a long bit of text containing the album id. It grabs that text and strips out the parts of it that arn't the album id. It then opens a prompt containing the remaining id.

Full annotated source code:
Quote:
(function(){
//Use jQuery library (already included in bandcamp) and grab 'lo_querystr' parameter from pagedata div in source
var str = $('#pagedata').data('blob').lo_querystr;
//Grab id by taking a substring starting at item_id= then removing the part that isn't the id
var id = str.substring(str.indexOf("item_id="), str.indexOf("item_id=") + 18).replace("item_id=","");
//Open prompt containing id
prompt("Copy this into a bandcamp tag as follows: [bandcamp]" + id + "[/bandcamp]", id);
})();

_________________
Camel of Doom: Terrestrial - Out Now on Solitude Productions


Fri Apr 01, 2016 9:30 pm
Profile WWW
Site Administrator
Site Administrator
User avatar

Joined: Mon Jul 09, 2007 3:39 pm
Posts: 8566
Location: UK
Reply with quote
Post Re: New Bandcamp tag

ok, Kris, thank you very much!

_________________
It's not Doom...


Sat Apr 02, 2016 7:16 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.