Welcome to WebmasterWorld Guest from 54.198.100.0

Forum Moderators: phranque

Message Too Old, No Replies

What language is this? (from Beatport.com)

     
7:35 pm on Dec 24, 2011 (gmt 0)

Junior Member

joined:Aug 15, 2011
posts:47
votes: 0


Thats from the bottom of the main page with disabled CSS:

[% _.each(data.artists, function(artist){ %] Follow [%=artist.name=%] [% }); %] Follow [%=data.label.name=%]
[% if(data.saleType === 'purchase') { %] [% print(BP.functions.formatCurrency(data.price, "usd")); %] [% } else { %] View Track [% } %]
[% _.each(data, function(item){ %] [% var classes = [], active = '', small = ''; if(item.children){ classes.push('parent'); } if(item.played){ classes.push('played'); } if(item.parentId){ classes.push('child'); small = 'small'; } if(item.queuePosition === (BP.queuePosition||-1) ){ classes.push('active'); active = 'active'; } %]
[% if(item.type == 'track'){ %] [%=item.title=%] [% } else { %] [%=item.name=%] [% } %] [% if(item.artists){ %] [%=BP.functions.renderTemplate('tmpl-player-artists', item )=%] [% } %] [% if(item.label){ %] [%=item.label.name=%] [% } %] [% if(item.releaseDate){ %] [%=item.releaseDate=%] [% } %] [% if(item.type==="track"||item.type==="release"||item.type==="chart"){ %] [%=BP.functions.renderTemplate('tmpl-btn-buy-small', item)=%] [% } %] X
[% }); %]


It looks a little bit like JavaScript, but I am not sure...
By the way, how do you think the website is implemented (music store, about 250k hits per day)?
What programming language do they use (or what would be the best language for a site like that)?
Do they play (preview) tracks from the disk evrytime somebody wants to listen (reference to files in MySQL, but actual files read from a disk etc)?
Just wondering...

Thank you.
12:39 am on Dec 25, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13210
votes: 347


Drat. If you had been asking about a human language, I would not rest until I found the answer ;)

I keep slamming into references to the Umbraco CMS, with side excursions into ASP. At first sight I thought you were nuts saying it looks like JavaScript, but it really does, doesn't it? Just wrap all the Javascript braces {} in [% tags %] and you're there. Hmm. Makes it sound like the computer equivalent of pig Latin.
1:17 am on Dec 25, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10553
votes: 13


it looks like a templating syntax that didn't get processed on the server side.
9:13 am on Dec 25, 2011 (gmt 0)

Junior Member

joined:Aug 15, 2011
posts:47
votes: 0


Thats all from the main page, several sections combined.


[% data.size = data.size ? data.size : 'medium'; %] [%=BP.functions.formatCurrency(data.price, "usd") =%]
[% data.size = 'small'; %] [%= BP.functions.renderTemplate('tmpl-btn-buy', data)=%]
[% switch(data.saleType){ case 'mixOnly': print(BP.functions.renderTemplate('tmpl-btn-mix-only',data)); break; case 'albumOnly': print(BP.functions.renderTemplate('tmpl-btn-album-only',data)); break; case 'download': print(BP.functions.renderTemplate('tmpl-btn-promo-dl',data)); break; case 'purchase': data.size = 'small'; print(BP.functions.renderTemplate('tmpl-btn-buy',data)); break; }%]
[% var rendered = []; _.each(data, function(genre){ genre.type = 'genre'; rendered.push( BP.templates['tmpl-item-link']({data:genre}) ); }); %] [%=rendered.join(', ')=%]
[%=data.name=%]
[%=data.title=%]
[%=data.name=%]
[%= BP.functions.renderArtistTemplate( data, 'remixer') =%]
[%= BP.functions.renderArtistTemplate( data, 'artist') =%]
[%=col.displayName=%]
[% _.each(columns, function(col){ print( BP.templates['tmpl-col-edit-row']({ col: col})); }); %]
[% shareHrefs = BP.functions.getShareHrefs(data); %]
[% if(data.filter.custom){ %] [%=BP.functions.renderTemplate('tmpl-filter-menu-custom-date-range', {filter: data.filter } )=%] [% } else { %] [%=BP.functions.renderTemplate('tmpl-filter-menu-group-available', { filter: data.filter })=%] [% } %]
[%=data.groupName=%]
[% _.each(data.group, function(filter, name){ if(filter.applied){ %] [%=BP.functions.renderTemplate('tmpl-filter-menu-group-applied', { filter: filter })=%] [% } else { %] [%=BP.functions.renderTemplate('tmpl-filter-menu-group-available', { filter: filter })=%] [% } %] [% }); %]
[% _.each( data.metadata.facets.fields, function(group, groupName){ %] [%=BP.functions.renderTemplate('tmpl-filter-menu-group', { group: group, groupName: groupName })=%] [% }); %]
[% for( var i in data.metadata.filtering.dateFilters) { var filter = data.metadata.filtering.dateFilters[i]; %] [% if(filter.applied) { %] [%=BP.functions.renderTemplate('tmpl-filter-menu-group-applied', { filter: filter })=%] [% } else { %] [%=BP.functions.renderTemplate('tmpl-filter-menu-date-available', {filter: filter } )=%] [% } %] [% } %]
[% var rendered = []; _.each(data.artists, function(artist){ artist.type = 'artist'; rendered.push( ['',''].join( BP.templates['tmpl-item-link']({data:artist}) )); }); print(rendered.join(', ')); %]
1:17 pm on Dec 25, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts: 12169
votes: 55


Do a search in Google for "BP.functions.renderTemplate". Something isn't quite right there. Google is indexing all that stuff. About 8,300,000 results.
4:52 pm on Dec 25, 2011 (gmt 0)

Junior Member

joined:Aug 15, 2011
posts:47
votes: 0


People said it is a template for asp .net or encoded JavaScript (2 separate answers).

Thats from "View source":

<script type="text/javascript">var BP={};</script>

My guess is that BP might be an object (although I might be confusing it with an array; Beatport player on the top of the page) and JavaScript is encoded in some way?
5:27 pm on Dec 25, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:6964
votes: 385


I don't use it, but a Bing search suggests the above might be data-json