-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.html
executable file
·232 lines (227 loc) · 14 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<p align="center">
<a href="client/img/dotino.png">
<img src="client/img/dotino.png" height="200" />
</a>
<br>
<br>
<b>Restaurants when they're mentioned. Not when they're marketed.</b>
</p>
<h1 id="implementation">Implementation</h1>
<h2 id="website">Website</h2>
<p>This website is hosted at <a href="https://dotino.com">https://dotino.com</a> on <a href="https://firebase.google.com">Google Firebase</a>, with the domain registered on <a href="https://namebright.com">NameBright</a>. The frontend is written in JavaScript with jQuery. Dotino uses <a href="https://d3js.org">D3.js</a> to parse the CSV file with Reddit comment information and <a href="listjs.com">List.js</a> to search cities and subreddits. Cities and their corresponding subreddits were retrieved from <a href="https://www.reddit.com/r/locationreddits">/r/LocationReddits</a>, and all Reddit comments containing the string "yelp.com/biz/" were queried using SQL with <a href="https://bigquery.cloud.google.com/table/fh-bigquery:reddit_comments.all">Google BigQuery</a> and saved as a flat CSV file. Only subreddits that are categorized as a "locational" subreddit <strong>and</strong> have at least one mention of "yelp.com/biz/" are included in this version of Dotino.</p>
<p>The local CSV file only contains data regarding the comment itself, and not the question it was written as a reply to, so the question's data is retrieved from <a href="https://api.reddit.com">https://api.reddit.com</a> using <em>by_id</em>. Restaurant data is retrieved from <a href="https://api.dotino.com">https://api.dotino.com</a>, which uses the <a href="https://www.yelp.com/developers">Yelp Fusion API</a>.</p>
<h2 id="api">API</h2>
<p>The server is hosted at <a href="https://api.dotino.com">https://api.dotino.com</a> with <a href="https://cloud.google.com/appengine">Google App Engine</a>. The backend is written in Python with the <a href="http://flask.pocoo.org">Flask</a> web framework and designed to work with the <a href="https://www.yelp.com/developers">Yelp Fusion API</a>. The SSL certificate was obtained from <a href="https://letsencrypt.org">LetsEncrypt</a>.</p>
<h2 id="the-dotino-logo">The Dotino Logo</h2>
<p>The logo is an SVG created with <a href="https://www.sketchapp.com">Sketch</a>.</p>
<h1 id="usage">Usage</h1>
<h2 id="website-1">Website</h2>
<p>Visit <a href="https://dotino.com">https://dotino.com</a> (<strong>with Tracking Protection disabled</strong> to enable compatibility with the Reddit API) and search for your desired city. Find restaurants mentioned on social media and click the question or the comment to see its context. Click the Yelp dot for more information about the restaurant.</p>
<p>Dotino has been optimized for desktop, tablet, and mobile usage. The motion background and navigation bar links to Privacy, Terms, and Contact are hidden on screen sizes 768 pixels and below to enhance mobile usability. Please access Dotino on a larger screen to experience the full website.</p>
<h2 id="api-1">API</h2>
<p><strong>Obtain Yelp business information for a specific restaurant with its Yelp business ID.</strong></p>
<p>GET from <a href="https://api.dotino.com/yelp?business=BUSINESS_ID_HERE">https://api.dotino.com/yelp?business=BUSINESS_ID_HERE</a> to return Yelp restaurant info in JSON. <a href="https://api.dotino.com">https://api.dotino.com</a> currently only accepts CORS Access-Control-Allow-Origin from <a href="https://dotino.com">https://dotino.com</a>.</p>
<p><strong>Response Body (<a href="https://www.yelp.com/developers/documentation/v3">from the Yelp Fusion API documentation</a>)</strong><br />~~~~<br />{<br /> "id": "gary-danko-san-francisco",<br /> "name": "Gary Danko",<br /> "image_url": "<a href="https://s3-media4.fl.yelpcdn.com/bphoto/">https://s3-media4.fl.yelpcdn.com/bphoto/</a>--8oiPVp0AsjoWHqaY1rDQ/o.jpg",<br /> "is_claimed": false,<br /> "is_closed": false,<br /> "url": "<a href="https://www.yelp.com/biz/gary-danko-san-francisco">https://www.yelp.com/biz/gary-danko-san-francisco</a>",<br /> "price": "$$$$",<br /> "rating": 4.5,<br /> "review_count": 4521,<br /> "phone": "+14152520800",<br /> "photos": [<br /> "<a href="http://s3-media3.fl.yelpcdn.com/bphoto/">http://s3-media3.fl.yelpcdn.com/bphoto/</a>--8oiPVp0AsjoWHqaY1rDQ/o.jpg",<br /> "<a href="http://s3-media2.fl.yelpcdn.com/bphoto/ybXbObsm7QGw3SGPA1_WXA/o.jpg">http://s3-media2.fl.yelpcdn.com/bphoto/ybXbObsm7QGw3SGPA1_WXA/o.jpg</a>",<br /> "<a href="http://s3-media3.fl.yelpcdn.com/bphoto/7rZ061Wm4tRZ-iwAhkRSFA/o.jpg">http://s3-media3.fl.yelpcdn.com/bphoto/7rZ061Wm4tRZ-iwAhkRSFA/o.jpg</a>"<br /> ],<br /> "hours": [<br /> {<br /> "hours_type": "REGULAR",<br /> "open": [<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 0,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 1,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 2,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 3,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 4,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 5,<br /> "start": "1730"<br /> },<br /> {<br /> "is_overnight": false,<br /> "end": "2200",<br /> "day": 6,<br /> "start": "1730"<br /> }<br /> ],<br /> "is_open_now": false<br /> }<br /> ],<br /> "categories": [<br /> {<br /> "alias": "newamerican",<br /> "title": "American (New)"<br /> }<br /> ],<br /> "coordinates": {<br /> "latitude": 37.80587,<br /> "longitude": -122.42058<br /> },</p>
<p>"location": {<br /> "address1": "800 N Point St",<br /> "address2": "",<br /> "address3": "",<br /> "city": "San Francisco",<br /> "state": "CA",<br /> "zip_code": "94109",<br /> "country": "US",<br /> "display_address": [<br /> "800 N Point St",<br /> "San Francisco, CA 94109"<br /> ],<br /> "cross_streets": "Hyde St & Larkin St"<br /> },<br /> "transactions": ["restaurant_reservation"]<br />}<br />~~~~</p>
<table>
<thead>
<tr class="header">
<th align="center"><strong>Name</strong></th>
<th align="center"><strong>Type</strong></th>
<th align="center"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">categories</td>
<td align="center">object[]</td>
<td align="center">A list of category title and alias pairs associated with this business.</td>
</tr>
<tr class="even">
<td align="center">categories[x].alias</td>
<td align="center">string</td>
<td align="center">Alias of a category, when searching for business in certain categories, use alias rather than the title.</td>
</tr>
<tr class="odd">
<td align="center">categories[x].title</td>
<td align="center">string</td>
<td align="center">Title of a category for display purpose.</td>
</tr>
<tr class="even">
<td align="center">coordinates</td>
<td align="center">object</td>
<td align="center">The coordinates of this business.</td>
</tr>
<tr class="odd">
<td align="center">coordinates.latitude</td>
<td align="center">decimal</td>
<td align="center">The latitude of this business.</td>
</tr>
<tr class="even">
<td align="center">coordinates.longitude</td>
<td align="center">decimal</td>
<td align="center">The longitude of this business.</td>
</tr>
<tr class="odd">
<td align="center">display_phone</td>
<td align="center">string</td>
<td align="center">Phone number of the business formatted nicely to be displayed to users. The format is the standard phone number format for the business's country.</td>
</tr>
<tr class="even">
<td align="center">hours</td>
<td align="center">object[]</td>
<td align="center">Opening hours of the business.</td>
</tr>
<tr class="odd">
<td align="center">hours[x].is_open_now</td>
<td align="center">boolean</td>
<td align="center">Whether the business is currently open or not.</td>
</tr>
<tr class="even">
<td align="center">hours[x].hours_type</td>
<td align="center">string</td>
<td align="center">The type of the opening hours information. Right now, always return REGULAR.</td>
</tr>
<tr class="odd">
<td align="center">hours[x].open</td>
<td align="center">object[]</td>
<td align="center">The detailed opening hours of each day in a week.</td>
</tr>
<tr class="even">
<td align="center">hours[x].open[x].day</td>
<td align="center">int</td>
<td align="center">From 0 to 6, representing day of the week from Monday to Sunday. Notice that you may get the same day of the week more than once if the business has more than one opening time slots.</td>
</tr>
<tr class="odd">
<td align="center">hours[x].open[x].start</td>
<td align="center">string</td>
<td align="center">Start of the opening hours in a day, in 24-hour clock notation, like 1000 means 10 AM.</td>
</tr>
<tr class="even">
<td align="center">hours[x].open[x].start</td>
<td align="center">string</td>
<td align="center">Start of the opening hours in a day, in 24-hour clock notation, like 1000 means 10 AM.</td>
</tr>
<tr class="odd">
<td align="center">hours[x].open[x].end</td>
<td align="center">string</td>
<td align="center">End of the opening hours in a day, in 24-hour clock notation, like 2130 means 9:30 PM.</td>
</tr>
<tr class="even">
<td align="center">hours[x].open[x].is_overnight</td>
<td align="center">boolean</td>
<td align="center">Whether the business opens overnight or not. When this is true, the end time will be lower than the start time.</td>
</tr>
<tr class="odd">
<td align="center">id</td>
<td align="center">string</td>
<td align="center">Yelp ID of this business.</td>
</tr>
<tr class="even">
<td align="center">image_url</td>
<td align="center">string</td>
<td align="center">URL of photo for this business.</td>
</tr>
<tr class="odd">
<td align="center">is_claimed</td>
<td align="center">bool</td>
<td align="center">Whether business has been claimed by a business owner</td>
</tr>
<tr class="even">
<td align="center">is_closed</td>
<td align="center">bool</td>
<td align="center">Whether business has been (permanently) closed</td>
</tr>
<tr class="odd">
<td align="center">location</td>
<td align="center">object</td>
<td align="center">The location of this business, including address, city, state, zip code and country.</td>
</tr>
<tr class="even">
<td align="center">location.address1</td>
<td align="center">string</td>
<td align="center">Street address of this business.</td>
</tr>
<tr class="odd">
<td align="center">location.address2</td>
<td align="center">string</td>
<td align="center">Street address of this business, continued.</td>
</tr>
<tr class="even">
<td align="center">location.address3</td>
<td align="center">string</td>
<td align="center">Street address of this business, continued.</td>
</tr>
<tr class="odd">
<td align="center">location.city</td>
<td align="center">string</td>
<td align="center">City of this business.</td>
</tr>
<tr class="even">
<td align="center">location.country</td>
<td align="center">string</td>
<td align="center">ISO 3166-1 alpha-2 country code of this business.</td>
</tr>
<tr class="odd">
<td align="center">location.cross_streets</td>
<td align="center">string</td>
<td align="center">Cross streets for this business.</td>
</tr>
<tr class="even">
<td align="center">location.display_address</td>
<td align="center">string[]</td>
<td align="center">Array of strings that if organized vertically give an address that is in the standard address format for the business's country.</td>
</tr>
<tr class="odd">
<td align="center">location.state</td>
<td align="center">string</td>
<td align="center">ISO 3166-2 State code of this business.</td>
</tr>
<tr class="even">
<td align="center">location.zip_code</td>
<td align="center">string</td>
<td align="center">Zip code of this business.</td>
</tr>
<tr class="odd">
<td align="center">name</td>
<td align="center">string</td>
<td align="center">Name of this business.</td>
</tr>
<tr class="even">
<td align="center">phone</td>
<td align="center">string</td>
<td align="center">Phone number of the business.</td>
</tr>
<tr class="odd">
<td align="center">photos</td>
<td align="center">object[]</td>
<td align="center">URLs of up to three photos of the business.</td>
</tr>
<tr class="even">
<td align="center">price</td>
<td align="center">string</td>
<td align="center">Price level of the business. Value is one of $, $$, $$$ and $$$$.</td>
</tr>
<tr class="odd">
<td align="center">rating</td>
<td align="center">decimal</td>
<td align="center">Rating for this business (value ranges from 1, 1.5, ... 4.5, 5).</td>
</tr>
<tr class="even">
<td align="center">review_count</td>
<td align="center">int</td>
<td align="center">Number of reviews for this business.</td>
</tr>
<tr class="odd">
<td align="center">url</td>
<td align="center">string</td>
<td align="center">URL for business page on Yelp.</td>
</tr>
<tr class="even">
<td align="center">transactions</td>
<td align="center">string[]</td>
<td align="center">A list of Yelp transactions that the business is registered for. Current supported values are "pickup", "delivery", and "restaurant_reservation".</td>
</tr>
</tbody>
</table>
<p><em>If you would like to host your own API, add your Yelp Fusion API key to config.ini.EXAMPLE and rename the file to config.ini.</em></p>