Beispiel #1
0
def index():
    os.environ["TZ"] = "US/Eastern"
    time.tzset()
    offset = int(time.strftime("%z")[-3])
    page_title = "EOTS iframe widget"
    page_url = FREEZER_BASE_URL.rstrip("/") + request.path
    client = soundcloud.Client(
        client_id=SOUNDCLOUD_API["client_id"],
        client_secret=SOUNDCLOUD_API["client_secret"],
        username=SOUNDCLOUD_API["username"],
        password=SOUNDCLOUD_API["password"],
    )
    tracks = client.get("/me/tracks", order="created_at", limit=SOUNDCLOUD_NUM_TRACKS)
    playlist_tracks = []
    for track in tracks:
        if track.streamable and "public" == track.sharing and len(playlist_tracks) < 5:

            d = {
                "title": track.title,
                "timestamp": formatTimestamp(getTimestamp(track.created_at, offset)),
                "duration": int(round(track.duration * 0.001)),
                "permalink": track.permalink_url,
                "stream": track.stream_url + "?client_id=" + SOUNDCLOUD_API["client_id"],
            }
            playlist_tracks.append(d)

    return render_template("content.html", tracks=playlist_tracks, page_title=page_title, page_url=page_url)
Beispiel #2
0
def index():
    page_title = 'Town Meeting Day 2017'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    return render_template('content.html',
                           page_title=page_title,
                           page_url=page_url,
                           results=results)
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)
Beispiel #4
0
def now_playing():
    page_title = 'Playing Now On VPR Classical'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    social = False

    return render_template('now-playing.html',
        page_title=page_title,
        page_url=page_url,
        social=social)
Beispiel #5
0
def playlist_calendar():
    page_title = 'VPR Classical Playlist Calendar'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    social = {
        'title': "VPR Classical Playlist Calendar",
        'subtitle': "",
        'img': "http://mediad.publicbroadcasting.net/p/vpr/files/styles/placed_wide/public/201407/vpr-classical-hosts.jpg",
        'description': "Looking for a piece you heard on VPR Classical today, yesterday or last month? Find it here!",
        'twitter_text': "Looking for something you heard on VPR Classical? Try our playlist calendar!",
        'twitter_hashtag': "Classical"
    }

    return render_template('content.html',
        page_title=page_title,
        page_url=page_url,
        social=social)
Beispiel #6
0
def index():
    page_title = 'Give Us Your Best Pitch'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    social = {
        'title': "Give Us Your Best Pitch!",
        'subtitle': "",
        'img': "http://www.vpr.net/apps/dorothys-list/static/img/facebook-share-logo.jpg",
        'description': "Give us your best pitch!",
        'twitter_text': "Give us your best pitch!",
        'twitter_hashtag': ""
    }

    return render_template('content.html',
        page_title=page_title,
        page_url=page_url,
        social=social)
Beispiel #7
0
def index():
    page_title = 'VPR App Template'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

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

    return render_template('content.html',
        page_title=page_title,
        page_url=page_url,
        social=social)
def index():
    page_title = "Timeline: A Year Of 'Systemic Failure' At DCF"
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    social = {
        'title': "Timeline: A Year Of 'Systemic Failure' At DCF",
        'subtitle': "This year has brought a series of tragedies and revelations about problems at Vermont's Department for Children and Families. VPR looks back over the months.",
        'img': "http://www.vpr.net/apps/timeline-dcf-systemic-failure/static/img/timeline-social-snap.png",
        'description': "This year has brought a series of tragedies and revelations about problems at Vermont's Department for Children and Families. VPR looks back over the months.",
        'twitter_text': "Timeline: A Year Of 'Systemic Failure' At DCF",
        'creator': "Taylor Dobbs and Angela Evancie",
        'twitter_hashtag': "VT"
    }

    return render_template('content.html',
        page_title=page_title,
        page_url=page_url,
        social=social)
Beispiel #9
0
def index():
    page_title = 'Give Us Your Best Pitch'
    page_url = FREEZER_BASE_URL.rstrip('/') + request.path

    social = {
        'title': "Give Us Your Best Pitch!",
        'subtitle': "",
        'img':
        "http://www.vpr.net/apps/dorothys-list/static/img/facebook-share-logo.jpg",
        'description': "Give us your best pitch!",
        'twitter_text': "Give us your best pitch!",
        'twitter_hashtag': ""
    }

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