Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added crawler for research software events(https://sorse.github.io/) #205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
uses: ./.github/actions/get-events-action
with:
crawler-name: "ConfsTech"
- id: sorse
name: Get sorse events
uses: ./.github/actions/get-events-action
with:
crawler-name: "Sorse"
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
Expand Down
1 change: 1 addition & 0 deletions crawlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from .python.python_crawler import PythonCrawler
from .pydata.pydata_crawler import PyDataCrawler
from .confs_tech.confs_tech_crawler import ConfsTechCrawler
from .sorse.sorse_crawler import SorseCrawler
1 change: 1 addition & 0 deletions crawlers/sorse/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
52 changes: 52 additions & 0 deletions crawlers/sorse/sorse_crawler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-

from ..base import BaseCrawler
from datetime import datetime
from bs4 import BeautifulSoup
import requests

class SorseCrawler(BaseCrawler):
def get_events(self):
# Populate this list of events using your code
events = []

# YOUR CODE HERE

URL = "https://sorse.github.io/programme/"

res = requests.get(URL)
soup = BeautifulSoup(res.text,"html.parser")

for event in soup.find_all("div",class_="card col-12 post-card"):
data = {
"name": None,
"url": "https://sorse.github.io/programme/",
"city": None,
"state": None,
"country": None,
"cfp_open": False,
"cfp_end_date": "1970-01-01",
"start_date": None,
"end_date": None,
"source": "https://sorse.github.io/programme",
"tags": None,
"kind": "conference",
"by": "bot",
}
temp = event.select("a[href]")
data["name"] = temp[0].get_text()
data["url"] += temp[0].get('href')
temp2 = event.select("time[datetime]")
try:
data["start_date"] = date_for(temp2[0].get_text().strip()[:-7])
except IndexError:
data["start_date"] = None
try:
data["end_date"] = date_for(temp2[0].get_text().strip()[:-7])
except IndexError:
data["end_date"] = None
self.events.append(data)

def date_for(s):
d = datetime.strptime(s,'%B %d, %Y')
return d.strftime('%d/%m/%Y')