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
(ns no2day.core | |
(:use [compojure.core :only [defroutes GET]] | |
ring.util.response | |
ring.middleware.cors) | |
(:require [org.httpkit.server :as http-kit] | |
[ring.middleware.reload :as reload] | |
[compojure.handler :as handler] | |
[clojure.tools.logging :as log] | |
[clj-wamp.server :as wamp])) |
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
http://blog.jayfields.com/2010/07/clojure-destructuring.html |
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
{ | |
"2014" : | |
{ | |
{ "AMAZONAS" : | |
{"partido1" : ["link1","link2"], | |
"partido2" : ["link1","link2"], | |
"partido3" : ["link1","link2"] } | |
}, | |
{ "ABANCAY" : | |
{"partido1" : ["link1","link2"], |
This file has been truncated, but you can view the full file.
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
{ | |
"20": { | |
"REGION1": { | |
"0": [ | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/ERM2014.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/ERM2014-2.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/ERM2014-3.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/ERM2014-4.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ER-2014/1eraEntrega_MR_ER2014.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ER-2014/2daEntrega_PP_MR_SER2014.pdf", |
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
{"24": {"Pasco": {"211": ["http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/MR/PIURA/PIURA_ MR AGRO SI.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/MR/PIURA/PIURA-AGRO SI-INGRESOS2.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/MR/PIURA/PIURA-MOV.REG.AGRO SI-ING-3.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/MR/PIURA/PIURA-AGRO SI-GASTOS2.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/MR/PIURA/PIURA-MOV.REG.AGRO SI-GAST-3.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/2014/MR/1erSem/PIURA/PIURA-AGRO SI.pdf"], "335": ["http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/OPLD/PIURA/HUANCABAMBA/CANCHAQUE/PIURA-OPLD FRENTE DEMOCRATICO PORE L CAMBIO DE CANCHAQUE-ING-3.pdf", "http://www.web.onpe.gob.pe/home/modFondosPartidarios/downloads/ERM-2014/OPLD/PIURA/HUANCABAMBA/CANCHAQUE/PIURA-OPLD FRENTE DEMOCRATICO POR EL CAMBI |
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
{ | |
"20": { | |
"Pasco": { | |
"0": [], | |
"63": [], | |
"64": [], | |
"65": [], | |
"66": [ | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/download_mr/ERM-2010-REG/PIURA/FUERZA_REGIONAL/ingresos_1.pdf", | |
"http://www.web.onpe.gob.pe/home/modFondosPartidarios/download_mr/ERM-2010-REG/PIURA/FUERZA_REGIONAL/gastos_1.pdf" |
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
Foreword | |
======== | |
This is a very rough draft of the tutorial I'm going to put on | |
compojure.org. It's not complete, but it covers most of the basics. | |
There's a possibility some of the terminology (such as handlers and | |
routes) might change, but I'll let you know if it does. The technical | |
content, however, should be accurate and up to date. | |
Criticism is very welcome; I'd like to know if anything is unclear or |
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
# coding: utf-8 | |
import requests | |
from requests import Session | |
import re | |
from pprint import pprint | |
import json | |
from time import sleep | |
url = 'http://steamcommunity.com/market/search/render/' |
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 requests | |
import json | |
items_list = requests.get('http://steamcommunity.com/market/appfilters/570') | |
items_json = json.loads(items_list.text) | |
heroes_list = items_json['facets']['570_Hero']['tags'] | |
heroes = [] | |
hero = {} | |
#for k,v in heroes_list.iteritems(): | |
for key in heroes_list: |
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
post: | |
description: Add a new user | |
operationId: addUser | |
parameters: | |
- name: user | |
in: body | |
description: New user to add | |
schema: | |
$ref: "#/definitions/NewUser" | |
responses: |