This file contains 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
// initiating a BOSH connection to create an anonymous connection to the Collecta XMPP server | |
connection = new Strophe.Connection(Config.BOSH_SERVICE); | |
connection.connect(Config.HOST, null, onConnect); |
This file contains 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
<message to="pedro@shorteye.com/escitorio" | |
from="cipriani@talleye.com/casa" | |
type="chat" > | |
<body>Cadê você?</body> | |
</message> |
This file contains 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
<presence from="cipriani@talleye.com/casa"> | |
<status>Ouvindo música...</status> | |
</presence> |
This file contains 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 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 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 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 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 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
// config.js | |
var Config = { | |
API_KEY: 'YOUR_COLLECTA_API_KEY', | |
BOSH_SERVICE: 'http://collecta.com/xmpp-httpbind', | |
HOST: "guest.collecta.com" | |
}; |
This file contains 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 + ", "; |