Ejemplo n.º 1
0
    def handle(self, *args, **options):
        from prometapi.bicikeljproxy.models import fetch_xmls, BicikeljData
        import simplejson

        timestamp, data = fetch_xmls()

        b = BicikeljData(timestamp=timestamp, json_data=simplejson.dumps(data))
        b.save()
Ejemplo n.º 2
0
	def handle(self, *args, **options):
		from prometapi.bicikeljproxy.models import fetch_xmls, BicikeljData, convert_citybikes
		import simplejson
		import datetime
		import urllib
		
		#timestamp, data = fetch_xmls()
		foreign_data = urllib.urlopen('http://api.citybik.es/bicikelj.json').read()
		
		data = convert_citybikes(foreign_data)
		timestamp = datetime.datetime.now()
		
		b = BicikeljData(timestamp=timestamp, json_data=simplejson.dumps(data))
		b.save()
Ejemplo n.º 3
0
    def handle(self, *args, **options):
        from prometapi.bicikeljproxy.models import fetch_xmls, BicikeljData, convert_citybikes
        import simplejson
        import datetime
        import urllib

        #timestamp, data = fetch_xmls()
        foreign_data = urllib.urlopen(
            'http://api.citybik.es/bicikelj.json').read()

        data = convert_citybikes(foreign_data)
        timestamp = datetime.datetime.now()

        b = BicikeljData(timestamp=timestamp, json_data=simplejson.dumps(data))
        b.save()