Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified fbcrawl/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified fbcrawl/__pycache__/items.cpython-37.pyc
Binary file not shown.
Binary file modified fbcrawl/__pycache__/settings.cpython-37.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions fbcrawl/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,6 @@ class EventsItem(scrapy.Item):
start_date = scrapy.Field()
end_date = scrapy.Field()
description = scrapy.Field()
going = scrapy.Field()
interested = scrapy.Field()
shared = scrapy.Field()
Binary file modified fbcrawl/spiders/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified fbcrawl/spiders/__pycache__/comments.cpython-37.pyc
Binary file not shown.
Binary file modified fbcrawl/spiders/__pycache__/fbcrawl.cpython-37.pyc
Binary file not shown.
11 changes: 9 additions & 2 deletions fbcrawl/spiders/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class EventsSpider(FacebookSpider):
name = "events"
custom_settings = {
'FEED_EXPORT_FIELDS': ['name','where','location','photo','start_date', \
'end_date','description'],
'end_date','description', 'going', 'interested', \
'shared'],
'DUPEFILTER_CLASS' : 'scrapy.dupefilters.BaseDupeFilter',
'CONCURRENT_REQUESTS' : 1
}
Expand Down Expand Up @@ -42,6 +43,9 @@ def parse_event(self, response):
DATE='/html/body/div/div/div[2]/div/table/tbody/tr/td/div[3]/div/div[1]/table/tbody/tr/td[2]/dt/div/text()'
EVENT_DESCRIPTION='/html/body/div/div/div[2]/div/table/tbody/tr/td/table/tbody/tr/td/div[2]/div[2]/div[2]/div[2]/text()'
EVENT_COVER='/html/body/div/div/div[2]/div/table/tbody/tr/td/div[2]/div[1]/a/img/@src'
GOING='/html/body/div/div/div[2]/div/table/tbody/tr/td/table/tbody/tr/td/div[2]/div[2]/div/div/div/div[2]/a/text()'
INTERESTED='/html/body/div/div/div[2]/div/table/tbody/tr/td/table/tbody/tr/td/div[2]/div[2]/div/div/div[2]/div[2]/a/text()'
SHARED='/html/body/div/div/div[2]/div/table/tbody/tr/td/table/tbody/tr/td/div[2]/div[2]/div/div/div[3]/div[2]/div/text()'
date = response.xpath(DATE).extract_first()
start_date = date.split('–')[0] or None
end_date = date.split('–')[1] or None
Expand All @@ -54,5 +58,8 @@ def parse_event(self, response):
photo=response.xpath(EVENT_COVER).extract_first(),
start_date=start_date,
end_date=end_date,
description=response.xpath(EVENT_DESCRIPTION).extract_first()
description=response.xpath(EVENT_DESCRIPTION).extract_first(),
going=response.xpath(GOING).extract_first(),
interested=response.xpath(INTERESTED).extract_first(),
shared=response.xpath(SHARED).extract_first()
)