This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="header"> | |
<ul class="header-menu"> | |
<li class="header-menu-list"><a class="header-menu-list-ancher" href="#">Menu Item 1</a></li> | |
<li class="header-menu-list"><a class="header-menu-list-ancher" href="#">Menu Item 2</a></li> | |
<li class="header-menu-list"><a class="header-menu-list-ancher active" href="#">Menu Item 3</a></li> | |
<li class="header-menu-list"><a class="header-menu-list-ancher" href="#">Menu Item 4</a></li> | |
<li class="header-menu-list"><a class="header-menu-list-ancher" href="#">Menu Item 5</a></li> | |
</ul> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script | |
data-key="x1234545648721" | |
class="the-social-digits" | |
data-api="#recommendations-complementary-prod" | |
data-limit="20" | |
data-language="danish" | |
data-products=["107"] | |
data-target="#recommendations-complementary-prod" | |
data-template="<li class='p_item {{id}}'><a href='{{ absolute_url }}'>hell0</a></li>" | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" charset="utf-8"> | |
TheSocialDigits.config({ | |
key: "1234567890", | |
templateFormatters: {my_link: function(absolute_url) { | |
return "href='"+absolute_url+"'" | |
} | |
}, | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_category(self, category_id): | |
pipe = r.pipeline(True) | |
category = Category.objects.get(pk=category_id) | |
category_key = 'category::da::{}'.format(category.slug) | |
data = [i for i in category.products_category_related.filter(product__daproduct__online=True).order_by('-order_by').values('product', 'order_by').distinct()] | |
products = DaProduct.extended.filter(pk__in=[i['product'] for i in data]) | |
self.readify([p.as_json for p in products]) | |
for p in data: | |
key = 'product::da::{}'.format(p['product']) | |
pipe.zadd(category_key, key, p['order_by']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"name": "Nike - Spilletr\u00f8je Trophy L/\u00c6 Sort/Hvid", "sizes": ["Small", "Large", "X-Large", "XX-Large"], "url": "/fodboldudstyr/nike-spilletroje-trophy-lae-sorthvid/69344/", "price": "249,00", "delivery": "5-14 dage", "id": 69344}, {"name": "Nike - Spilletr\u00f8je Trophy L/\u00c6 Hvid/Sort ", "sizes": ["Small", "Large", "X-Large", "XX-Large"], "url": "/fodboldudstyr/nike-spilletroje-trophy-lae-hvidsort/69345/", "price": "249,00", "delivery": "5-14 dage", "id": 69345}, {"name": "Nike - Mercurial Vapor IX ACC FG Lilla/Gr\u00f8n ", "sizes": ["EU 40\u00bd/US 7\u00bd", "EU 42/US 8\u00bd", "EU 42\u00bd/US 9", "EU 43/US 9\u00bd", "EU 44/US 10", "EU 44\u00bd/US 10\u00bd", "EU 45/US 11", "EU 45\u00bd/US 11\u00bd", "EU 46/US 12", "EU 47/US 12\u00bd", "EU 47\u00bd/US 13"], "url": "/fodboldstoevler/nike-mercurial-vapor-ix-acc-fg-lillagron/96866/", "price": "1499,00", "delivery": "1-2 dage", "id": 96866}, {"name": "Manchester United - Tandb\u00f8rste 2-Pak", "sizes": ["One Size"], "url": "/fodboldtroejer/manche |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='{{id}}' class="carousel"> | |
<script src="http://static.thesocialdigits.com/v1/thesocialdigits.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
TheSocialDigits.config({ | |
key: "xSrDcW401rnXiBkEfjOKAs2YPaGMFW0q", | |
dataSource: function(products, callback) {$.getJSON('/tsd-data/', {'products':products.join()}),callback}, | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import requests | |
import lxml.html as l | |
from lxml import etree | |
# web2py chapters are 0-14 | |
baseurl = "https://web2py.com/books/default/chapter/29/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Products : NSObject | |
{ | |
NSMutableArray *productItems; | |
} | |
-(void)getResource:(NSString *)uri; // this should start the connection and retrieve payload | |
-(NSArray *)productItems; // use this to hold on to the payload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
items = { | |
_call: function(id, href) { | |
API_KEY = ''; // <-- api key here | |
url = 'http://api.thesocialdigits.com/v1/__log_click?callback=?'; | |
payload = {'key': API_KEY, 'product': id, 'metadata': {'api': 'search', 'args': {}}}; | |
$.getJSON(url, {'payload': JSON.stringify(payload)}, function(data) { | |
if (data.status === 'error') { | |
/* | |
something wen't wrong |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log_click = function(parent) { | |
$.each($(parent).children(), function(index, val) { | |
$(val).click(function(e) { | |
e.preventDefault() | |
var href, metadata, t, _href; | |
metadata = {api: "search",args: ""}; | |
href = $(this).find('a').attr('href'); | |
t = setTimeout("window.location.href = \"" + href + "\";", 500); | |
_href = href.split("/"); |