Skip to content

Instantly share code, notes, and snippets.

View grobertson's full-sized avatar

Grant Robertson grobertson

View GitHub Profile
//create namespace
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var dot = dot || {};
dot.native = dot.native || {};
dot.native.ads = dot.native.ads || {};
//Just configurations. These plaements may or may not exist
# Quick Hit stories in the last 24 hours
select count(created)
from articles_ddarticle
where age(modified, created) < interval '1 hour'
and age(localtimestamp, created) < interval '1 day'
limit 50;
# Biggest social hits, last 72 hours
Ad placements.
Google Publisher Tag docs are here: https://developers.google.com/doubleclick-gpt/reference?hl=en
-Page loads.
dot.ads.AdService
1) Instantiate dot.ads.AdService
- Singleton
- Declares goog.structs.Map() instances for placements_ and AdSlots_
$('#id_video_id').live('paste', function() {
var onFail = function(found) {
alert('Unsupported video service or invalid URL');
console.log(found);
}
var element = this;
var parser = document.createElement('a');
setTimeout(function () {
parser.href = $(element).val();
var videoId = new String();
'widgets': {
'article-entertainment': 548,
'article-lifestyle': 546,
'article-news': 541,
'article-esports': 536,
'article-geek': 533,
'article-technology': 531,
'article-politics': 529,
'article-business': 524,
'article-crime': 522,
$('#id_video_id').live('paste', function() {
var onFail = function(found) {
alert('Unsupported video service or invalid URL');
console.log(found);
}
var element = this;
var parser = document.createElement('a');
setTimeout(function () {
parser.href = $(element).val();
var videoId = new String();
$('#id_video_id').live('paste', function() {
var onFail = function(found) {
alert('Unsupported video service or invalid URL');
console.log(found);
$(element).val('');
return false;
}
var element = this;
var parser = document.createElement('a');
setTimeout(function () {
{% load media %}
{% block meta %}
{# Meta items within this block are dynamic. Things like facebook app_id which persist across all pages are found in base.html #}
{% if article_detail.title %}
{# This is a single article #}
{% include "site/meta/article.html" %}
{% elif comic.title %}
{# This is a single comic #}
{% include "site/meta/comic.html" %}
{% elif comic_artist.name %}
"""
Add any additional URLs that should only be available when using the the
settings.development configuration.
See ``urls.defaults`` for a list of all URLs available across both
configurations.
"""
from configurations import Settings
from .defaults import *
SpokenLayer.prototype.setPlayerFile = function() {
//We prefer Mp3
if(this.browserMp3Support){
this.setSrc(this.articleMp3);
this.setReady(true);
}else if(this.browserOggSupport){
this.setSrc(this.articleOgg);
this.setReady(true);
}else{
this.log('No audio support detected');