Repository: alltheplaces/alltheplaces

Issue:
Hard Rock
https://www.hardrock.com/locations.aspx


Discussion:
Specifically what do you need?
Hello, thanks for reaching out. I've labeled issues in the repository that are good options for creating your first spider. The ultimate goal is to scrape the URL linked above (or a better one if you find it) for [location information](https://github.com/alltheplaces/alltheplaces/blob/master/DATA_FORMAT.md) regarding the business. The project is built using [scrapy](https://docs.scrapy.org/en/latest/), so there is more documentation there the can also assist you as well. Feel free to comb through the spiders in the [locations folder](https://github.com/alltheplaces/alltheplaces/tree/master/locations) for guidance on completed spiders, see [university_maryland_medical_system.py](https://github.com/alltheplaces/alltheplaces/blob/43ae0183827f340925555029e26b3810730be268/locations/spiders/university_maryland_medical_system.py) and [credit_agricole.py](https://github.com/alltheplaces/alltheplaces/blob/c0b9dfe7379e8fef192fc319fcebe2b10b352204/locations/spiders/credit_agricole.py) as examples. If you find an issue that you think looks interesting, let me know and I will assign it to you, and feel free to reach out if you have more questions.
I thought this was something easier. I'm sorry I can't take up this issue, hope you can find someone will.
Hi @thekuiperbelt, 

I'm ready to take up this issue. I have already created the spider and here is the sample output,

```json
{"type": "Feature", "id": "87MFYRLF5WB7VcMJVWycvd1CiuY=", "properties": {"ref": "Location1", "@spider": "hardrock", "addr:street": "Cetinjska 1 Capital Plaza", "addr:city": "Podgorica", "addr:postcode": "81000", "addr:country": "Montenegro", "name": "Hard Rock Cafe Podgorica", "phone": "+382 20 226 992", "website": "https://www.hardrockcafe.com/location/podgorica/", "brand": "Hard Rock"}, "geometry": {"type": "Point", "coordinates": [19.24448, 42.43965]}},
{"type": "Feature", "id": "QptdEs5LSJqdwHkTkRZ2KrWPYrI=", "properties": {"ref": "Location2", "@spider": "hardrock", "addr:street": "Carr PR #2 Km.228.9 Ave. Santiago de los Caballeros", "addr:city": "Ponce", "addr:postcode": "00717", "addr:country": "Puerto Rico", "name": "Hard Rock Cafe Ponce", "website": "https://www.hardrockcafe.com/location/ponce/", "brand": "Hard Rock"}, "geometry": {"type": "Point", "coordinates": [66.60401, 17.99704]}},
{"type": "Feature", "id": "nyORTy-5zuWG88K1j5wfkGwTlPs=", "properties": {"ref": "Location3", "@spider": "hardrock", "addr:street": "Port El Kantaoui, Sousse", "addr:city": "Port El Kantaoui", "addr:postcode": "4089", "addr:country": "Tunisia", "name": "Hard Rock Cafe Port El Kantaoui", "phone": "+ 216 73 347 300", "website": "https://www.hardrockcafe.com/location/port-el-kantaoui/", "brand": "Hard Rock"}, "geometry": {"type": "Point", "coordinates": [10.5461, 35.90697]}},
{"type": "Feature", "id": "HpyD_tdWSspSyD3LC05vQM_aodE=", "properties": {"ref": "Location4", "@spider": "hardrock", "addr:street": "Rua do Almada, 120", "addr:city": "Porto", "addr:postcode": "4005-031", "addr:country": "Portugal", "name": "Hard Rock Cafe Porto", "phone": "+351 227664470", "website": "https://www.hardrockcafe.com/location/porto/", "brand": "Hard Rock"}, "geometry": {"type": "Point", "coordinates": [-8.61419, 41.14717]}},
{"type": "Feature", "id": "6Mh2va-PLbifP2GB3suF6fH93Cg=", "properties": {"ref": "Location5", "@spider": "hardrock", "addr:street": "424 South 4th Street", "addr:city": "Louisville", "addr:postcode": "40202", "addr:country": "United States", "name": "Hard Rock Cafe Louisville", "phone": "+1-502-568-2202", "website": "https://www.hardrockcafe.com/location/louisville/", "brand": "Hard Rock"}, "geometry": {"type": "Point", "coordinates": [-85.75744, 38.25229]}}
```

Resolving patch:
diff --git a/locations/spiders/hard_rock.py b/locations/spiders/hard_rock.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/hard_rock.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+import json
+
+import scrapy
+from locations.items import GeojsonPointItem
+
+
+class HardRockSpider(scrapy.Spider):
+    name = 'hardrock'
+    item_attributes = {'brand': 'Hard Rock'}
+    allowed_domains = ['www.hardrock.com']
+    start_urls = ['https://www.hardrock.com/files/5880/widget935343.js?callback=widget935343DataCallback']
+
+    def parse(self, response):
+        data = json.loads(response.text.replace('widget935343DataCallback(', '').replace(');', ''))
+        for location in data.get('PropertyorInterestPoint', []):
+            properties = {
+                'name': location['interestpointpropertyname'],
+                'ref': location['ClassIndex'],
+                'street': location['interestpointpropertyaddress'],
+                'city': location['interestpointCity'],
+                'postcode': location['interestpointPostalCode'],
+                'state': location['interestpointStateFullName'],
+                'country': location['LocationCountry'],
+                'lat': float(location['interestpointinterestlatitude']),
+                'lon': float(location['interestpointinterestlongitude']),
+                'phone': location['interestpointPhoneNumber'],
+                'website': location['interestpointMoreInfoLink']
+            }
+            yield GeojsonPointItem(**properties)


Test patch: