Skip to content

Commit

Permalink
Merged conflics
Browse files Browse the repository at this point in the history
  • Loading branch information
silent1mezzo committed Apr 14, 2012
2 parents 35bf1dd + 6864dea commit fc8995a
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 5 deletions.
10 changes: 8 additions & 2 deletions hackto/apps/around/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import requests
import json

BUSINESSES = {'schools': [{u'distance': u'0.4', u'name': u'Bishop Marrocco-Thomas Merton', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P1A3', u'street': u'1515 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656857', u'longitude': u'-79.449874'}, u'type': u'REGULAR', u'id': u'5912827'}, {u'distance': u'0.4', u'name': u'Howard Jr PS', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1T2', u'street': u'30 Marmaduke St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.650256', u'longitude': u'-79.451646'}, u'type': u'REGULAR', u'id': u'792847'}, {u'distance': u'0.4', u'name': u'Park Place LINC Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1X7', u'street': u'2299 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.655515', u'longitude': u'-79.452229'}, u'type': u'REGULAR', u'id': u'5896244'}, {u'distance': u'0.4', u'name': u'West Park Secondary School', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P1A3', u'street': u'1515 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656857', u'longitude': u'-79.449874'}, u'type': u'REGULAR', u'id': u'5870112'}, {u'distance': u'0.5', u'name': u'Kikkawa College & Teaching Clinic', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'4141028'}, {u'distance': u'0.5', u'name': u'Kikkawa College & Teaching Clinic ICT Schools(www.ICTSchools.com)', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'5884405'}, {u'distance': u'0.5', u'name': u'Trebas Institute', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'3770146'}, {u'distance': u'0.6', u'name': u'Conseil scolaire de district catholique Centre-Sud', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3Y1', u'street': u'330 Lansdowne Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.65286', u'longitude': u'-79.440749'}, u'type': u'REGULAR', u'id': u'7950019'}, {u'distance': u'0.8', u'name': u'Brock Jr PS', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3S4', u'street': u'93 Margueretta St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.652835', u'longitude': u'-79.438094'}, u'type': u'REGULAR', u'id': u'2140157'}, {u'distance': u'0.8', u'name': u'High Park Gardens Montessori School', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1S8', u'street': u'35 High Park Gdns', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.649031', u'longitude': u'-79.456491'}, u'type': u'REGULAR', u'id': u'6262838'}], 'day cares': [{u'distance': u'0.4', u'name': u'West End Child Care Services', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P3L4', u'street': u'1411 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.657372', u'longitude': u'-79.447341'}, u'type': u'REGULAR', u'id': u'1702119'}, {u'distance': u'0.4', u'name': u'Candy Factory Child Care Center', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P3L4', u'street': u'1411 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.657372', u'longitude': u'-79.447341'}, u'type': u'REGULAR', u'id': u'299622'}, {u'distance': u'0.4', u'name': u"Howard Park Children's Centre", u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1T2', u'street': u'30 Marmaduke St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.650256', u'longitude': u'-79.451646'}, u'type': u'REGULAR', u'id': u'792885'}, {u'distance': u'0.6', u'name': u'Kids Zone Daycare', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1S6', u'street': u'76 Constance St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.64907', u'longitude': u'-79.453577'}, u'type': u'REGULAR', u'id': u'3264800'}, {u'distance': u'0.8', u'name': u'Brock Early Learning Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3S4', u'street': u'93 Margueretta St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.652835', u'longitude': u'-79.438094'}, u'type': u'REGULAR', u'id': u'2140149'}, {u'distance': u'0.8', u'name': u'My School Co-Op Nursery', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M2', u'street': u'116 Fermanagh Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646913', u'longitude': u'-79.446081'}, u'type': u'REGULAR', u'id': u'1104139'}, {u'distance': u'0.8', u'name': u'Network Child Care Service Of Metropolitan Toronto Inc', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3Y5', u'street': u'544 Lansdowne Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.6595', u'longitude': u'-79.443129'}, u'type': u'REGULAR', u'id': u'2430614'}, {u'distance': u'0.8', u'name': u'Sunnyside Day Care', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M4', u'street': u'10 High Park Blvd', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646095', u'longitude': u'-79.45019'}, u'type': u'REGULAR', u'id': u'4015203'}, {u'distance': u'0.8', u'name': u'Sunshine Child Care Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M2', u'street': u'116 Fermanagh Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646913', u'longitude': u'-79.446081'}, u'type': u'REGULAR', u'id': u'1530181'}]}
#BUSINESSES = {'schools': [{u'distance': u'0.4', u'name': u'Bishop Marrocco-Thomas Merton', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P1A3', u'street': u'1515 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656857', u'longitude': u'-79.449874'}, u'type': u'REGULAR', u'id': u'5912827'}, {u'distance': u'0.4', u'name': u'Howard Jr PS', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1T2', u'street': u'30 Marmaduke St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.650256', u'longitude': u'-79.451646'}, u'type': u'REGULAR', u'id': u'792847'}, {u'distance': u'0.4', u'name': u'Park Place LINC Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1X7', u'street': u'2299 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.655515', u'longitude': u'-79.452229'}, u'type': u'REGULAR', u'id': u'5896244'}, {u'distance': u'0.4', u'name': u'West Park Secondary School', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P1A3', u'street': u'1515 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656857', u'longitude': u'-79.449874'}, u'type': u'REGULAR', u'id': u'5870112'}, {u'distance': u'0.5', u'name': u'Kikkawa College & Teaching Clinic', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'4141028'}, {u'distance': u'0.5', u'name': u'Kikkawa College & Teaching Clinic ICT Schools(www.ICTSchools.com)', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'5884405'}, {u'distance': u'0.5', u'name': u'Trebas Institute', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P4A9', u'street': u'2340 Dundas St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.656793', u'longitude': u'-79.45257'}, u'type': u'REGULAR', u'id': u'3770146'}, {u'distance': u'0.6', u'name': u'Conseil scolaire de district catholique Centre-Sud', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3Y1', u'street': u'330 Lansdowne Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.65286', u'longitude': u'-79.440749'}, u'type': u'REGULAR', u'id': u'7950019'}, {u'distance': u'0.8', u'name': u'Brock Jr PS', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3S4', u'street': u'93 Margueretta St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.652835', u'longitude': u'-79.438094'}, u'type': u'REGULAR', u'id': u'2140157'}, {u'distance': u'0.8', u'name': u'High Park Gardens Montessori School', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1S8', u'street': u'35 High Park Gdns', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.649031', u'longitude': u'-79.456491'}, u'type': u'REGULAR', u'id': u'6262838'}], 'day cares': [{u'distance': u'0.4', u'name': u'West End Child Care Services', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P3L4', u'street': u'1411 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.657372', u'longitude': u'-79.447341'}, u'type': u'REGULAR', u'id': u'1702119'}, {u'distance': u'0.4', u'name': u'Candy Factory Child Care Center', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6P3L4', u'street': u'1411 Bloor St W', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.657372', u'longitude': u'-79.447341'}, u'type': u'REGULAR', u'id': u'299622'}, {u'distance': u'0.4', u'name': u"Howard Park Children's Centre", u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1T2', u'street': u'30 Marmaduke St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.650256', u'longitude': u'-79.451646'}, u'type': u'REGULAR', u'id': u'792885'}, {u'distance': u'0.6', u'name': u'Kids Zone Daycare', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1S6', u'street': u'76 Constance St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.64907', u'longitude': u'-79.453577'}, u'type': u'REGULAR', u'id': u'3264800'}, {u'distance': u'0.8', u'name': u'Brock Early Learning Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3S4', u'street': u'93 Margueretta St', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.652835', u'longitude': u'-79.438094'}, u'type': u'REGULAR', u'id': u'2140149'}, {u'distance': u'0.8', u'name': u'My School Co-Op Nursery', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M2', u'street': u'116 Fermanagh Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646913', u'longitude': u'-79.446081'}, u'type': u'REGULAR', u'id': u'1104139'}, {u'distance': u'0.8', u'name': u'Network Child Care Service Of Metropolitan Toronto Inc', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6H3Y5', u'street': u'544 Lansdowne Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.6595', u'longitude': u'-79.443129'}, u'type': u'REGULAR', u'id': u'2430614'}, {u'distance': u'0.8', u'name': u'Sunnyside Day Care', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M4', u'street': u'10 High Park Blvd', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646095', u'longitude': u'-79.45019'}, u'type': u'REGULAR', u'id': u'4015203'}, {u'distance': u'0.8', u'name': u'Sunshine Child Care Centre', u'Deal': None, u'address': {u'city': u'Toronto', u'pcode': u'M6R1M2', u'street': u'116 Fermanagh Ave', u'prov': u'ON'}, u'geoCode': {u'latitude': u'43.646913', u'longitude': u'-79.446081'}, u'type': u'REGULAR', u'id': u'1530181'}]}

from libraries.yellow.yellowbetter import YellowBetterAPI
from libraries.yellow import yellowcache

# Create your views here.
def index(request):
Expand All @@ -30,9 +33,12 @@ def search(request):
if form.is_valid():
address = form.cleaned_data['address']
dict['address'] = address
#api = YellowBetterAPI(api_key= '', where = address, uid='hackto2', test_mode=False)
#dict['businesses'] = api.categoriesAndBusinesses()
dict['businesses'] = yellowcache.getResults(address)
dict['lat'],dict['lon'] = get_lat_long(address)

dict['businesses'] = BUSINESSES
#dict['businesses'] = BUSINESSES
else:
form = SearchForm()

Expand Down
Empty file added hackto/libraries/__init__.py
Empty file.
44 changes: 44 additions & 0 deletions hackto/libraries/setup-twilio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from twilio import __version__
from setuptools import setup, find_packages

# To install the twilio-python library, open a Terminal shell, then run this
# file by typing:
#
# python setup.py install
#
# You need to have the setuptools module installed. Try reading the setuptools
# documentation: http://pypi.python.org/pypi/setuptools

setup(
name = "twilio",
version = __version__,
description = "Twilio API client and TwiML generator",
author = "Twilio",
author_email = "help@twilio.com",
url = "http://github.com/twilio/twilio-python/",
keywords = ["twilio","twiml"],
install_requires = ["httplib2 >= 0.7, < 0.8", "pyjwt==0.1.2"],
packages = find_packages(),
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Communications :: Telephony",
],
long_description = """\
Python Twilio Helper Library
----------------------------
DESCRIPTION
The Twilio REST SDK simplifies the process of makes calls to the Twilio REST.
The Twilio REST API lets to you initiate outgoing calls, list previous calls,
and much more. See http://www.github.com/twilio/twilio-python for more information.
LICENSE The Twilio Python Helper Library is distributed under the MIT
License """ )
Empty file.
7 changes: 4 additions & 3 deletions hackto/libraries/yellow/yellowbetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ def availableCategories(self):

def categoriesAndBusinesses(self):
result = {}
for category in self.categories.keys():
categories = self.availableCategories()
for category in categories:
bizListings = self.find_inArea(what=category)
result[category] = [biz for biz in bizListings]
return result

def find_inArea(self, what, page=None, page_len=None,
sflag=None, lang=None, maxDistance=float(1.0), debug=0, maxResults=10):
sflag=None, lang=None, maxDistance=float(15.0), debug=0, maxResults=10):
where = self.where
uid = self.uid
try:
Expand All @@ -60,7 +61,7 @@ def find_inArea(self, what, page=None, page_len=None,
if float(listing.get('distance')) < float(maxDistance):
self.clean_listing(listing)
filteredResults.append(listing)
if len(filteredResults) >= maxResults:
if len(filteredResults) == maxResults:
break
if debug:
for result in filteredResults:
Expand Down
11 changes: 11 additions & 0 deletions hackto/libraries/yellow/yellowcache.py

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ South==0.7.4
Werkzeug==0.8.3
django-extensions==0.8
requests
sphinx
mock
httplib2
nose
pyjwt
simplejson
unittest2

0 comments on commit fc8995a

Please sign in to comment.