internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: alltheplaces/alltheplaces

Issue:
Merkur
https://www.merkurmarkt.at/marktplatz/ihr-einkauf/maerkte-und-oeffnungszeiten


Discussion:

Resolving patch:
diff --git a/locations/spiders/merkur.py b/locations/spiders/merkur.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/merkur.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+import json
+import re
+
+import scrapy
+
+from locations.items import GeojsonPointItem
+from locations.hours import OpeningHours
+
+
+class MerkurSpider(scrapy.Spider):
+    name = "merkur"
+    item_attributes = {'brand': 'Merkur', 'brand_wikidata': 'Q1921857'}
+    allowed_domains = ['merkurmarkt.at']
+    start_urls = [
+        'https://www.merkurmarkt.at/maerkte',
+    ]
+
+    def parse(self, response):
+        yield scrapy.Request('https://www.merkurmarkt.at/api/stores',
+                             headers={'Accept': 'application/json',
+                                      "correlationid": "af939ee6-26a9-4af4-bf8c-34a9bfc29b2b"},
+                             callback=self.parse_stores)
+
+    def parse_hours(self, hours):
+        opening_hours = OpeningHours()
+
+        for item in hours:
+            try:
+                open_time, close_time = item["time"].split(' - ')
+            except KeyError:
+                continue
+            opening_hours.add_range(day=item["dayOfWeek"][:2],
+                                    open_time=open_time,
+                                    close_time=close_time)
+
+        return opening_hours.as_opening_hours()
+
+    def parse_stores(self, response):
+        stores = json.loads(response.body_as_unicode())
+
+        for store in stores:
+            properties = {
+                'name': store["displayName"],
+                'ref': store["storeId"],
+                'addr_full': store["street"],
+                'city': store["city"],
+                'state': store['province'],
+                'postcode': store["zip"],
+                'country': "AT",
+                'phone': store["phone"],
+                'lat': float(store["coordinate"]["y"]),
+                'lon': float(store["coordinate"]["x"]),
+            }
+
+            hours = self.parse_hours(store["openingTimes"])
+            if hours:
+                properties["opening_hours"] = hours
+
+            yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
David's Bridal
https://www.davidsbridal.com/DBIStoresDirectoryView?catalogId=10051&langId=-1


Discussion:

Resolving patch:
diff --git a/locations/spiders/davids_bridal.py b/locations/spiders/davids_bridal.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/davids_bridal.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+import re
+import json
+
+import scrapy
+
+from locations.items import GeojsonPointItem
+from locations.hours import OpeningHours
+
+
+DAY_MAPPING = {
+    'Mo':0,
+    'Tu':0,
+    'We':0,
+    'Th':0,
+    'Fr':0,
+    'Sa':1,
+    'Su':2
+}
+
+
+class DavidsBridalSpider(scrapy.Spider):
+    name = "davids_bridal"
+    item_attributes = {'brand': 'Davids Bridal'}
+    allowed_domains = ['www.davidsbridal.com']
+    start_urls = [
+        'https://www.davidsbridal.com/DBIStoresDirectoryView',
+    ]
+    download_delay = 0.3
+
+    def parse_hours(self, hours):
+        opening_hours = OpeningHours()
+        for day in DAY_MAPPING:
+            open_close = hours[DAY_MAPPING[day]]
+            if open_close.lower() in ['closed', '']:
+                continue
+            else:
+                open_time, close_time = open_close.split(' - ') 
+                opening_hours.add_range(day=day,
+                                        open_time=open_time,
+                                        close_time=close_time,
+                                        time_format='%I:%M%p'
+                                        )
+
+        return opening_hours.as_opening_hours()
+    
+    def parse(self, response):
+        locations = response.xpath('//div[@class="span6"]/a/@href').extract()
+        for location in locations:
+            yield scrapy.Request(location, callback=self.parse_store)
+
+    def parse_store(self, response):
+        # Handle closed stores
+        try: 
+            store_data = json.loads(response.xpath('//script[@type="application/ld+json"]/text()').extract_first())
+            
+            properties = {
+            'ref':  re.search(r'stLocId=([0-9]+)', response.url).group(1),
+            'name': store_data['name'],
+            'addr_full': store_data['address']['streetAddress'],
+            'city': store_data['address']['addressLocality'],
+            'state': store_data['address']['addressRegion'],
+            'postcode': store_data['address']['postalCode'],
+            'country': store_data['address']['addressCountry'],
+            'phone': store_data['telephone'],
+            'website': response.url,
+            'lat': store_data['geo'].get('latitude', ''),
+            'lon': store_data['geo'].get('longitude', ''),
+            }
+
+            hours = store_data.get('openingHours')
+            if hours:
+                properties['opening_hours'] = self.parse_hours(hours)
+
+            yield GeojsonPointItem(**properties)
+
+        except json.decoder.JSONDecodeError:
+            pass
+       
\ No newline at end of file


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Camille La Vie
https://camillelavie.com/locations


Discussion:

Resolving patch:
diff --git a/locations/spiders/camillelavie.py b/locations/spiders/camillelavie.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/camillelavie.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+import re
+
+import scrapy
+
+from locations.items import GeojsonPointItem
+
+
+class BedBathBeyondSpider(scrapy.Spider):
+    name = "camillelavie"
+    item_attributes = {'brand': "Camille La Vie"}
+    allowed_domains = ["camillelavie.com"]
+    start_urls = (
+        'https://camillelavie.com/locations',
+    )
+
+    def parse(self, response):
+        urls = response.xpath('//div[@class="dontsplit"]/div[1]/h3/a/@href').extract()
+
+        for url in urls:
+            yield scrapy.Request(response.urljoin(url), callback=self.parse_location)
+
+    def parse_location(self, response):
+        ref = re.search(r'.+/(.+)', response.url).group(1)
+        coordinates = response.xpath('//td[@valign="top"][2]/a/@href').extract_first()
+        lat_lng = re.findall(r'([-]?[\d]+[.][\d]*)', coordinates)
+
+
+        properties = {
+            'ref': ref.strip('/'),
+            'addr_full': response.xpath('//table[@class="locations"]/tbody//h3/div/span[2]/span/text()').extract_first(),
+            'city': response.xpath('//table[@class="locations"]/tbody//h3/div/span[3]/text()').extract_first(),
+            'state': response.xpath('//table[@class="locations"]/tbody//h3/div/span[4]/text()').extract_first(),
+            'postcode': response.xpath('//table[@class="locations"]/tbody//h3/div/span[5]/text()').extract_first(),
+            'phone': response.xpath('//table[@class="locations"]/tbody//h3/div/span[6]/span/text()').extract_first(),
+            'name': response.xpath('//table[@class="locations"]/tbody//h3/div/span[1]/text()').extract_first(),
+            'lat': float(lat_lng[0]),
+            'lon': float(lat_lng[1]),
+            'website': response.url
+        }
+
+        yield GeojsonPointItem(**properties)
\ No newline at end of file


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
PetSuites
https://www.petsuitesofamerica.com/locations


Discussion:

Resolving patch:
diff --git a/locations/spiders/pet_suites.py b/locations/spiders/pet_suites.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/pet_suites.py
@@ -0,0 +1,42 @@
+import json
+import scrapy
+from locations.items import GeojsonPointItem
+from locations.hours import OpeningHours
+
+
+class PetSuitesSpider(scrapy.Spider):
+    name = "pet_suites"
+    allowed_domains = ["yext.com"]
+    start_urls = (
+        'https://liveapi.yext.com/v2/accounts/me/entities?filter=%7B%20%22meta.folderId%22%3A%7B%22%24in%22%3A[249017]%7D%7D&limit=50&api_key=2bc9758495549d8bd15fe1c10fdcd617&v=20161012',
+    )
+
+    def process_hours(self, hours):
+        output = OpeningHours()
+        for day, data in hours.items():
+            day_fmted = day[0].upper() + day[1].lower()
+            hours_data = data.get('openIntervals')
+            if not hours_data:
+                continue
+            hours_data = hours_data[0]
+            output.add_range(day_fmted, hours_data['start'], hours_data['end'])
+    
+        return output.as_opening_hours()
+
+    def parse(self, response):
+        data = json.loads(response.text).get("response")
+        for entity in data['entities']:
+            yield GeojsonPointItem(
+                lat=entity['geocodedCoordinate']['latitude'],
+                lon=entity['geocodedCoordinate']['longitude'],
+                name=entity['name'],
+                addr_full=entity['address']['line1'],
+                city=entity['address']['city'],
+                state=entity['address']['region'],
+                postcode=entity['address']['postalCode'],
+                country=entity['address']['countryCode'],
+                phone=entity['mainPhone'],
+                website=entity['websiteUrl']['url'],
+                opening_hours=self.process_hours(entity['hours']),
+                ref=entity['c_googleMyBusinessCID'],
+            )


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Curaleaf
https://curaleaf.com/locations/


Discussion:
I can go ahead and tackle this. I couldn't quite find a way to assign myself. Could you assign me to this? Thanks. 
No need to assign. Just start working on it.

Resolving patch:
diff --git a/locations/spiders/curaleaf.py b/locations/spiders/curaleaf.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/curaleaf.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+import scrapy
+import json
+from locations.items import GeojsonPointItem
+import re
+
+
+class CuraleafSpider(scrapy.Spider):
+    name = "curaleaf"
+    allowed_domains = ["curaleaf.com"]
+    start_urls = (
+        'https://curaleaf.com/locations/',
+    )
+
+    def parse(self, response):
+        urls = response.xpath('//div[@class="button2"]/a/@href').extract()
+        for url in urls:
+            yield scrapy.Request(response.urljoin(url), callback=self.parse_location)
+
+    def parse_location(self, response):
+        location_data = response.xpath(
+            '/html/head/meta[18]/@content').extract_first().split(';')
+        latitude = location_data[0]
+        longitude = location_data[1]
+        street = response.xpath(
+            '//div[@class="storeLocation-template-module--address--3-eLF"]/p/text()').extract_first()
+        city = response.xpath(
+            '//div[@class="storeLocation-template-module--address--3-eLF"]/p[2]/text()').extract_first().split(',')[0]
+        # grab p text containing city, state, zip, next line uses re to grab state
+        city_state_zip = response.xpath(
+            '//div[@class="storeLocation-template-module--address--3-eLF"]/p[2]/text()').extract_first()
+        # re to grab state from city_state_zip
+        state = re.search(r'[a-zA-Z]+(?:\s+[a-zA-Z]+)*(?=[^,]*$)', city_state_zip)[0]
+        postcode = int(response.xpath(
+            '//div[@class="storeLocation-template-module--address--3-eLF"]/p[2]/text()').extract_first().split()[-1])
+        country = 'US'
+        address = "{} {} {} {}".format(street, city, state, postcode)
+        properties = {
+            'name': 'Curaleaf',
+            'ref': response.url,
+            'website': response.url,
+            'lat': float(latitude),
+            'lon': float(longitude),
+            'street': street,
+            'city': city,
+            'state': state,
+            'postcode': postcode,
+            'country': country,
+            'addr_full': address
+        }
+
+        yield GeojsonPointItem(**properties)
\ No newline at end of file


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Orkin
https://www.orkin.com/locations


Discussion:

Resolving patch:
diff --git a/locations/spiders/orkin.py b/locations/spiders/orkin.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/orkin.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+import scrapy
+
+from locations.items import GeojsonPointItem
+
+
+class OrkinSpider(scrapy.Spider):
+    name = "orkin"
+    item_attributes = {'brand': "Orkin", 'brand_wikidata': "Q7102943"}
+    allowed_domains = ["orkin.com"]
+    download_delay = 0.1
+    start_urls = (
+        'https://www.orkin.com/locations',
+    )
+
+    def parse(self, response):
+        urls = response.xpath('//div[@class="states row"]//li/a/@href').extract()
+
+        for url in urls:
+            yield scrapy.Request(response.urljoin(url), callback=self.parse_city)
+
+    def parse_city(self, response):
+        location_urls = response.xpath('//div[@class="row"][1]//li/a/@href').extract()
+
+        for url in location_urls:
+            yield scrapy.Request(response.urljoin(url), callback=self.parse_location)
+
+    def parse_location(self, response):
+
+        properties = {
+            'ref': response.xpath('//section[@class="branch-data"]/@data-branch-id').extract_first(),
+            'addr_full': response.xpath('//span[@itemprop ="streetAddress"]/text()').extract_first(),
+            'city': response.xpath('//span[@itemprop ="addressLocality"]/text()').extract_first(),
+            'state': response.xpath('//span[@itemprop ="addressRegion"]/text()').extract_first(),
+            'phone': response.xpath('//span[@itemprop="telephone"]/text()').extract_first(),
+            'name': response.xpath('//h1[@class="locations-title"]/text()').extract_first(),
+            'website': response.url
+        }
+
+        yield GeojsonPointItem(**properties)
\ No newline at end of file


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Living Spaces
https://www.livingspaces.com/stores


Discussion:

Resolving patch:
diff --git a/locations/spiders/livingspaces.py b/locations/spiders/livingspaces.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/livingspaces.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+import json
+import re
+
+import scrapy
+
+from locations.items import GeojsonPointItem
+
+
+class LivingSpacesSpider(scrapy.Spider):
+    name = "livingspaces"
+    item_attributes = {'brand': "Living Spaces", 'brand_wikidata': "Q63626177"}
+    allowed_domains = ["livingspaces.com"]
+    download_delay = 0.1
+    start_urls = (
+        'https://www.livingspaces.com/stores',
+    )
+
+
+    def parse(self, response):
+        urls = response.xpath('//div[@class="st-detail"]/a/@href').extract()
+
+        for url in urls:
+            yield scrapy.Request(response.urljoin(url), callback=self.parse_location)
+
+    def parse_location(self, response):
+        data = response.xpath('//script[@type="application/ld+json" and contains(text(), "streetAddress")]/text()').extract_first()
+        ref = re.search(r'.+/(.+?)/?(?:\.html|$)', response.url).group(1)
+
+        if data:
+            store_data = json.loads(data)
+
+            properties = {
+
+                'ref': ref,
+                'name': response.xpath('//h1[@class="page-title"]/text()').extract_first().strip(),
+                'addr_full': store_data["address"]["streetAddress"],
+                'city': store_data["address"]["addressLocality"],
+                'state': store_data["address"]["addressRegion"],
+                'postcode': store_data["address"]["postalCode"],
+                'country': store_data["address"]["addressCountry"],
+                'phone': store_data.get("telephone"),
+                'lat': float(store_data["geo"]["latitude"]),
+                'lon': float(store_data["geo"]["longitude"]),
+                'website': store_data.get("url")
+            }
+
+            yield GeojsonPointItem(**properties)
+
+        else:
+            pass
\ No newline at end of file


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Care One
https://www.care-one.com/locations/


Discussion:
What is the issue that needs solved?
@burketrevor 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 as well. If you find an issue that you think looks interesting, go ahead and assign it to yourself and feel free to reach out if you have more questions.

Resolving patch:
diff --git a/locations/spiders/care_one.py b/locations/spiders/care_one.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/care_one.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+import scrapy
+
+from locations.items import GeojsonPointItem
+from scrapy.selector import Selector
+
+class CareOneSpider(scrapy.Spider):
+    name = "care_one"
+    allowed_domains = ["care-one.com"]
+    start_urls = (
+        'https://www.care-one.com/locations/',
+    )
+
+    def parse(self, response):
+        pois = response.xpath('//script[@type="text/javascript" and contains(text(), "locations_results.push")]/text()').extract()
+
+        for poi in pois:
+            address = Selector(text=poi).xpath('//p[@class="\\\'museo"]/text()').extract()
+            city_state_postcode = address[-2].split(", ")
+            info = Selector(text=poi).xpath('//p/text()').get().split("\n")
+            geo = info[1].split("new result_node(")[1].split(",")
+            lat = float(geo[0].strip("'"))
+            lon = float(geo[1].strip().strip("'"))
+
+            properties = {
+                'ref': int(info[2].split(", ")[0]),
+                'website': Selector(text=poi).xpath('//a/@href').get().strip("\\'"),
+                'name': Selector(text=poi).xpath('//h6/text()').get(),
+                'addr_full': ", ".join(address[:-1]),
+                'city': city_state_postcode[0],
+                'state': city_state_postcode[1].split()[0],
+                'postcode': city_state_postcode[1].split()[1],
+                'country': 'US',
+                'phone': address[-1],
+                'lat': lat,
+                'lon': lon,
+            }
+
+            yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Farmers home Furniture
http://farmershomefurniture.com/locator


Discussion:
Hi, I am interested in picking this up. Shall I work on this if nobody else is?
Go for it!

Resolving patch:
diff --git a/locations/spiders/farmershomefurniture.py b/locations/spiders/farmershomefurniture.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/farmershomefurniture.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+import re
+
+import scrapy
+from locations.hours import OpeningHours
+from locations.items import GeojsonPointItem
+
+DAYS = {
+    "0": "Mo",
+    "1": "Tu",
+    "2": "We",
+    "3": "Th",
+    "4": "Fr",
+    "5": "Sa",
+    "6": "Su"
+}
+
+
+class FarmersHomeFurnitureSpider(scrapy.Spider):
+    name = 'farmershomefurniture'
+    item_attributes = {'brand': 'Farmers Home Furniture'}
+    allowed_domains = ['www.farmershomefurniture.com']
+    start_urls = ['https://www.farmershomefurniture.com/store-list.inc']
+    download_delay = 1
+    headers = {
+        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) "
+                  "Chrome/63.0.3239.84 Safari/537.36"
+    }
+
+    def parse(self, response):
+        for store in response.xpath('//tr'):
+            store_data = store.xpath('./td/text()').getall()
+            if store_data:
+                properties= {
+                    'city': store_data[0],
+                    'state': store_data[1],
+                    'address': store_data[2],
+                    'phone': store_data[3]
+                }
+
+                store_link = store.xpath('./@onclick').re_first('/stores/[0-9a-z-]+.inc')
+                store_url = 'https://www.farmershomefurniture.com/{}'.format(store_link)
+
+                yield scrapy.Request(store_url, callback=self.parse_store, cb_kwargs=properties)
+
+
+    def parse_store(self, response, city, state, address, phone):
+        opening_hours = OpeningHours()
+        store_hours = response.xpath('//div[@class="workspacearea"]/div/div/p/text()').extract()[2:]
+
+        for hours in store_hours:
+            day, time = hours.strip().split(':')
+            if day != 'Sun':
+                time_range= time.split('-')
+                if time_range[0] != 'Closed':
+                    opening_hours.add_range(day=day[:2],
+                                        open_time=time_range[0].strip()+":00",
+                                        close_time=time_range[1].strip()+":00"
+                                        )
+
+        store_coordinates= response.xpath('//script/text()').re_first('lat .*[\n].*').split(';')[:2]
+
+        properties = {
+                'addr_full': address,
+                'city': city,
+                'phone': phone,
+                'state': state,
+                'lat': store_coordinates[0].split('"')[1],
+                'lon': store_coordinates[1].split('"')[1],
+                'opening_hours': opening_hours.as_opening_hours(),
+                'ref': re.search(r'.+/(.+?)/?(?:\.inc|$)', response.url).group(1)
+        }
+
+        yield GeojsonPointItem(**properties)


Test patch: