GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

report_text()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
1
import requests
2
from bs4 import BeautifulSoup
3
import dateparser
4
5
from .scrape_sugarloaf_lifts_trails import update_time
6
7
URL = 'http://sugarloaf.com/the-mountain/daily-report'
8
9
10
def report_text(soup):
11
    """Returns the HTML paragraphs from the daily report"""
12
    report_div = soup.find('div', {'class': 'daily-report'})
13
    output = ''
14
15
    paragraphs = report_div.find_all('p')
16
17
    for p in paragraphs:
18
        output += p.decode()
19
    
20
    return output
21
22
23
def report_reporter(soup):
24
    """Returns a string with the current Snow Reporter's name"""
25
    report_div = soup.find('div', {'class': 'daily-report'})
26
    reporter = report_div.find('div', {'class': 'signature'}).find('strong')
27
    try:
28
        return reporter.contents[0]
29
    except AttributeError:
30
        return None
31
32
33
def make_soup():
34
    r = requests.get(URL)
35
    return BeautifulSoup(r.content, 'lxml')