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
<link rel="stylesheet" type="text/css" href="http://static.tumblr.com/n9ku3gx/bmmlda7os/prettify.css"/> | |
<script type="text/javascript" src="http://static.tumblr.com/n9ku3gx/1k0lda7q0/jquery.min.js"></script> | |
<script type="text/javascript" src="http://static.tumblr.com/n9ku3gx/DiKlda7r3/prettify.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('pre.colorthis').addClass('prettyprint'); | |
prettyPrint(); | |
}); | |
</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
USE "http://github.com/lfcipriani/yql-feira-livre-sp/raw/master/yql-feira-livre-sp.xml" AS feiras; | |
SELECT * FROM feiras WHERE zone = 'SUL' AND dayOfTheWeek = 'DOMINGO'; |
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
default xml namespace = ''; | |
var result = <markets /> | |
for (i = 0; i < marketList.length; i++) { | |
result.markets += <market><dayOfTheWeek>{marketList[i].day}</dayOfTheWeek><address>{marketList[i].address}</address></market>; | |
} | |
response.object = result; |
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
default xml namespace = ''; | |
for each (var item in xdata) { | |
if (i == 0) { | |
day = item.toString().trim(); | |
} else if (i == 1) { | |
address += item.toString().trim() + ", "; | |
} else if (i == 2) { | |
number = item.toString().trim(); | |
if (number != "S/N" && number.length != 0) { | |
address += number + ", "; |
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
var postData = "zona="+ zone +"&dia=" + dayOfTheWeek; | |
var data = request.accept('text/html'). | |
contentType("application/x-www-form-urlencoded"). | |
post(postData).response; | |
var xdata = y.xpath(data, "//font[@color='Red']"); |
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
<markets> | |
<market> | |
<dayOfTheWeek>DOMINGO</dayOfTheWeek> | |
<address>RUA CONDE DE PORTO ALEGRE, Sao Paulo, Brazil</address> | |
</market> | |
<market> | |
<dayOfTheWeek>DOMINGO</dayOfTheWeek> | |
<address>AV AMADEU DA SILVA SAMELLO, Sao Paulo, Brazil</address> | |
</market> | |
... |
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
<table> | |
<meta>...</meta> | |
<bindings> | |
<select itemPath="" produces="JSON" > | |
<urls> | |
<url>http://www3.prefeitura.sp.gov.br/feiras/feiras.asp</url> | |
</urls> | |
<inputs> | |
<key id="dayOfTheWeek" type="xs:string" paramType="variable" default="todos" /> | |
<key id="zone" type="xs:string" paramType="variable" required="true" /> |
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
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Luis Cipriani (@lfcipriani)</author> | |
<description> | |
Busca por Feiras Livres em São Paulo, por dia da semana e zona da cidade. | |
- As zonas possíveis são: CENTRAL, NORTE, SUL, LESTE e OESTE. | |
- Os dias da semana possíveis são: DOMINGO, TERCA, QUARTA, QUINTA, SEXTA, SÁBADO. | |
- Deixe o dia da semana em branco para pesquisar em todos os dias de uma vez só. | |
</description> | |
<sampleQuery><![CDATA[ SELECT * FROM {table} WHERE zone = 'CENTRAL' ]]></sampleQuery> |
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
<HTML> | |
<HEAD></HEAD> | |
<BODY> | |
<HEAD><TITLE>ENDERECO DAS FEIRAS POR DIA </TITLE> | |
</HEAD> | |
<BODY bgcolor="f9cd8a"> | |
<!--BODY background="/img_feiras/feiras.GIF"--><br> | |
<center> | |
<!--img src="/img_feiras/logo1.GIF" border=0 align=top><BR> | |
<font color=#006666 size=5><B><I>RELAÇÃO DE FEIRAS</I></B></FONT><BR--> |
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 onMessage(msg) { | |
// messages stanzas are converted to JSON and then prepended to the correspondent panel in the UI | |
var result = Collecta.processItem($(msg)); | |
for (var i=0; i < result.length; i++) { | |
$('#term'+ result[i].term +"panel") | |
.prepend("<p>["+result[i].category+"] - <a href=\""+result[i].url+"\" target=\"_blank\" title=\" Access "+terms[result[i].term]+" information\">"+result[i].title+"</a><br />..."+result[i].description+"...<br />Published in "+result[i].published+"</p>"); | |
}; | |
return true; | |
} |