Example #1
0
def index():
    tags = [446989232]
    page_url = BASE_URL + request.path
    page_title = "Full Coverage Of Bernie Sanders' Presidential Run"
    page_explainer = "Full Coverage Of Bernie Sanders' Presidential Run"
    audio_clips_explainer = "Hear Bernie Sanders' Political Views (Not) Evolve Over The Decades"
    underwriter_explainer = "Support From"
    announcement_explainer = "Full Audio: Bernie Sanders Announces His Run For President"
    stories = api_feed(tags, numResults=10, thumbnail=True)
    featured1 = api_feed([403584370], numResults=1, thumbnail=True, sidebar=True)
    featured2 = api_feed([392561138], numResults=1, thumbnail=True, sidebar=True)
    npr = api_feed([], numResults=1, thumbnail=True, sidebar=True)

    social = {
        'title': "Full Coverage Of Bernie Sanders' Presidential Run",
        'subtitle': "From VPR",
        'img': 'http://mediad.publicbroadcasting.net/p/vpr/files/styles/medium/public/201504/sanders-3-vpr-evancie-20141104.jpg',
        'description': "Campaign news, features and analysis from the news team at Vermont Public Radio.",
        'twitter_text': "Full Coverage Of Bernie Sanders' Presidential Run",
        'twitter_hashtag': "VT"
    }

    return render_template('content.html',
        page_title=page_title,
        page_explainer=page_explainer,
        audio_clips_explainer=audio_clips_explainer,
        underwriter_explainer=underwriter_explainer,
        announcement_explainer=announcement_explainer,
        stories=stories,
        social=social,
        featured1=featured1,
        featured2=featured2,
        npr=npr,
        page_url=page_url)
Example #2
0
def index():
    tags = [237184207]
    page_url = BASE_URL + request.path
    page_title = 'Campaign 2014'
    page_explainer = ["VPR's guide to the 2014 campaign season. Get our latest coverage, special features and election news apps all in one place."]
    stories = api_feed(tags, numResults=10, thumbnail=True)

    #To add featured stories to right panel of topic page, add story API IDs
    featured_ids = [347984643, 354095938,
        353539996, 349262333, 338098842, 341672291]

    featured = []
    for f_id in featured_ids:
        featured.append(api_feed([f_id], numResults=1, thumbnail=True, sidebar=True)[0])

    social = {
        'title': "Campaign 2014",
        'subtitle': '',
        'img': '',
        'description': "VPR's guide to the 2014 campaign season. Get our latest coverage, special features and election news apps all in one place.",
        'twitter_text': "VPR's guide to the 2014 campaign season.",
        'twitter_hashtag': ''
    }

    return render_template('content.html',
        page_title=page_title,
        page_explainer=page_explainer,
        stories=stories,
        social=social,
        featured=featured,
        page_url=page_url)
Example #3
0
def index():
    page_url = BASE_URL + request.path
    page_title = 'Vermonters In Sochi'
    stories = api_feed([262757810], numResults=10)

    field_list = ['name', 'event', 'age', 'home', 'career', 'story',
        'us', 'italy', 'canada', 'credit', 'result2014']
    athletes = drive_to_json('0AtWnpcGxoF0xdFE4QU56eTZnN0wwNjZ2NDMwN2RoeXc', field_list)
    results = drive_to_json('0AtWnpcGxoF0xdFE4QU56eTZnN0wwNjZ2NDMwN2RoeXc',
        ['name', 'event', 'medal'],
        sheet='od5')

    sports = drive_to_json('0AtWnpcGxoF0xdFE4QU56eTZnN0wwNjZ2NDMwN2RoeXc',
        ['name', 'event1', 'vermonter1', 'event2', 'vermonter2', 'event3', 'vermonter3', 'event4', 'vermonter4'],
        sheet='od4')
    for sport in sports:
        sport['events'] = [sport['event1'],
            sport['event2'],
            sport['event3'],
            sport['event4']]
        sport['vermonters'] = [sport['vermonter1'],
            sport['vermonter2'],
            sport['vermonter3'],
            sport['vermonter4']]

    photos = drive_to_json('0AtWnpcGxoF0xdFE4QU56eTZnN0wwNjZ2NDMwN2RoeXc',
        ['url', 'caption', 'credit'],
        sheet='od7')
    photos[0]['url'] = generate_thumbnail(photos[0]['url'],
        preserve_ratio=True, size=(2000, 1000))
    photos[1]['url'] = generate_thumbnail(photos[1]['url'],
        size=(375, 250))
    photos[2]['url'] = generate_thumbnail(photos[2]['url'],
        size=(375, 250))
    updated = drive_to_json('0AtWnpcGxoF0xdFE4QU56eTZnN0wwNjZ2NDMwN2RoeXc',
        ['updated'],
        sheet='oda')

    for athlete in athletes:
        athlete['image'] = "%s.jpg" % (athlete['name'].title().replace(' ', '-'))

    social = {
        'title': "Olympics 2014: Vermonters in Sochi",
        'subtitle': "VPR's Coverage Of The 2014 Olympics",
        'img': photos[0]['url'],
        'description': "Read athlete bios and see final results of Vermonters in the Sochi Games.",
        'twitter_text': "Olympics 2014: Vermonters in Sochi",
        'twitter_hashtag': "Olympics,VT,Sochi2014"
    }

    return render_template('content.html',
        page_title=page_title,
        social=social,
        stories=stories,
        athletes=athletes,
        results=results,
        sports=sports,
        photos=photos,
        updated=updated,
        page_url=page_url)
Example #4
0
def index():
    tags = [237184207]
    page_url = BASE_URL + request.path
    page_title = 'Campaign 2014'
    page_explainer = ["VPR's guide to the 2014 campaign season. Get our latest coverage, special features and election news apps all in one place."]
    stories = api_feed(tags, numResults=10, thumbnail=True)
    reporters = reporter_list(tags)

    featured = False
    #To add featured stories to right panel of topic page, add story API IDs
    #featured = api_feed([291752955, 292002570], numResults=2, thumbnail=True, sidebar=True)

    social = {
        'title': "",
        'subtitle': '',
        'img': '',
        'description': "",
        'twitter_text': "",
        'twitter_hashtag': ''
    }

    return render_template('content.html',
        page_title=page_title,
        page_explainer=page_explainer,
        stories=stories,
        social=social,
        featured=featured,
        reporters=reporters,
        page_url=page_url)
Example #5
0
def index():
    tags = [427048436]
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path
    page_title = "Latest VPR Stories"
    stories = api_feed(tags, numResults=10, thumbnail=True)

    return render_template('content.html',
                           page_title=page_title,
                           page_url=page_url,
                           stories=stories)
Example #6
0
def index():
    tags = [446989232]
    page_url = BASE_URL + request.path
    page_title = "Full Coverage Of Bernie Sanders' Presidential Run"
    page_explainer = "Full Coverage Of Bernie Sanders' Presidential Run"
    audio_clips_explainer = "Hear Bernie Sanders' Political Views (Not) Evolve Over The Decades"
    underwriter_explainer = "Support From"
    announcement_explainer = "Full Audio: Bernie Sanders Announces His Run For President"
    stories = api_feed(tags, numResults=10, thumbnail=True)
    featured1 = api_feed([403584370],
                         numResults=1,
                         thumbnail=True,
                         sidebar=True)
    featured2 = api_feed([392561138],
                         numResults=1,
                         thumbnail=True,
                         sidebar=True)
    npr = api_feed([], numResults=1, thumbnail=True, sidebar=True)

    social = {
        'title': "Full Coverage Of Bernie Sanders' Presidential Run",
        'subtitle': "From VPR",
        'img':
        'http://mediad.publicbroadcasting.net/p/vpr/files/styles/medium/public/201504/sanders-3-vpr-evancie-20141104.jpg',
        'description':
        "Campaign news, features and analysis from the news team at Vermont Public Radio.",
        'twitter_text': "Full Coverage Of Bernie Sanders' Presidential Run",
        'twitter_hashtag': "VT"
    }

    return render_template('content.html',
                           page_title=page_title,
                           page_explainer=page_explainer,
                           audio_clips_explainer=audio_clips_explainer,
                           underwriter_explainer=underwriter_explainer,
                           announcement_explainer=announcement_explainer,
                           stories=stories,
                           social=social,
                           featured1=featured1,
                           featured2=featured2,
                           npr=npr,
                           page_url=page_url)
Example #7
0
def index():
    page_url = BASE_URL + request.path
    page_title = 'Health Care In Vermont'
    stories = api_feed([245948266, 186100276], numResults=10, thumbnail=True)
    follow_the_money = api_feed([255414453])[0]

    social = {
        'title': "VPR: Healthcare Coverage 2014",
        'subtitle': 'www.vpr.net/apps/health/',
        'img': 'http://www.vpr.net/apps/health/static/img/under_the_hood_share_photo_vpr.png',
        'description': "VPR's guide to health care in Vermont. Includes coverage of the health care exchange, the latest in state policy and implementation of a single payer system in Vermont.",
        'twitter_text': "VPR's guide to healthcare in VT. Latest coverage, exchange updates and the road to single payer",
        'twitter_hashtag': 'VTpoli'
    }

    return render_template('content.html',
        page_title=page_title,
        stories=stories,
        social=social,
        page_url=page_url,
        follow=follow_the_money)
Example #8
0
def index():
    tags = [170839705]
    page_url = BASE_URL + request.path
    page_title = 'Vermont Legislature'
    page_explainer = ["VPR's guide to the Vermont Legislature. Latest coverage, statehouse streams and legislative resources, all in one place."]
    stories = api_feed(tags, numResults=10, thumbnail=True)
    featured = api_feed([291752955, 292002570], numResults=2, thumbnail=True, sidebar=True)

    social = {
        'title': "VPR: Vermont Legislature 2014",
        'subtitle': 'www.vpr.net/apps/legislature/',
        'img': 'http://mediad.publicbroadcasting.net/p/vpr/files/201401/statehouse-january.jpg',
        'description': "VPR's guide to the Vermont Legislature. Latest coverage, statehouse streams and legislative resources, all in one place.",
        'twitter_text': "VPR's guide to the VT legislature. Latest coverage, statehouse streams and legislative resources",
        'twitter_hashtag': 'VTpoli'
    }

    return render_template('content.html',
        page_title=page_title,
        page_explainer=page_explainer,
        stories=stories,
        social=social,
        featured=featured,
        page_url=page_url)
Example #9
0
def new_tweet():
    tags = [178480359]
    story = api_feed(tags, numResults=1)
    today = date.today()

    digital_tweet = (story)[0]["date"] + ": " + (story)[0]["title"] + " " + (story)[0]["link"]
    archive_tweet = new_archive_tweet()

    random_tweet = random.randint(1, 2)

    if random_tweet == 1:
        tweet = digital_tweet
    else:
        tweet = archive_tweet

    if date.weekday(today) == 3:
        return tweet + " #tbt"
    else:
        return tweet
Example #10
0
def new_tweet():
    tags = [178480359]
    story = api_feed(tags, numResults=1)
    today = date.today()

    digital_tweet = (story)[0]["date"] + ": " + (story)[0]["title"] + " " + (
        story)[0]["link"]
    archive_tweet = new_archive_tweet()

    random_tweet = random.randint(1, 2)

    if random_tweet == 1:
        tweet = digital_tweet
    else:
        tweet = archive_tweet

    if date.weekday(today) == 3:
        return tweet + " #tbt"
    else:
        return tweet
Example #11
0
def index():
    page_url = BASE_URL + request.path
    page_title = 'School Closings'
    school_closings, timestamp = closings()
    recent_news = api_feed([178480359], numResults=5)

    social = {
        'title': "Is Your School Closed Today?",
        'subtitle': "VPR's School Closing Listings",
        'img': "static/img/vpr_school_closings_2.jpg",
        'description': "Find the list of school cancellations and delays, by county, in Vermont and areas of New York and New Hampshire. This list is provided by the VAB and is smartphone and tablet friendly.",
        'twitter_text': "Is your school closed today? Find out using VPR's smartphone friendly listings",
        'twitter_hashtag': "vtwx"
    }

    return render_template('content.html',
        page_title=page_title,
        school_closings=school_closings,
        social=social,
        timestamp=timestamp,
        recent_news=recent_news,
        page_url=page_url)