Esempio n. 1
0
def new_comments():
    query = request.args.get('q')
    api = API.using_request(request)
    if query:
        rss_title = 'Hacker News: "%s" comments' % query
    else:
        rss_title = 'Hacker News: New Comments'
    rss = RSS(api.comments(), rss_title, 'https://news.ycombinator.com/newcomments')
    return rss.response()
Esempio n. 2
0
def newest():
    query = request.args.get('q')
    api = API.using_request(request)
    if query:
        rss_title = 'Hacker News: "%s"' % query
    else:
        rss_title = 'Hacker News: Newest'
    rss = RSS(api.newest(), rss_title, 'https://news.ycombinator.com/newest')
    return rss.response()
Esempio n. 3
0
def user_threads():
    username = request.args.get('id')
    api = API.using_request(request)
    api_response = api.user(username, 'threads')

    rss_title = 'Hacker News: %s threads RSS feed' % username
    rss_link = 'https://news.ycombinator.com/threads?id=%s' % username
    rss = RSS(api_response, rss_title, rss_link)
    return rss.response()
Esempio n. 4
0
def user_submitted():
    username = request.args.get('id')
    api = API.using_request(request)
    api_response = api.user(username, 'submitted')

    rss_title = 'Hacker News: %s submitted RSS feed' % username
    rss_link = 'https://news.ycombinator.com/submitted?id=%s' % username
    rss = RSS(api_response, rss_title, rss_link)
    return rss.response()
Esempio n. 5
0
def who_is_hiring(include=None):
    api = API.using_request(request)
    if include is None:
        rss = RSS(api.who_is_hiring('all'), 'whoishiring', 'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'jobs':
        rss = RSS(api.who_is_hiring(include), 'whoishiring - Who is hiring?', 'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'hired':
        rss = RSS(api.who_is_hiring(include), 'whoishiring - Who wants to be hired?', 'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'freelance':
        rss = RSS(api.who_is_hiring(include), 'whoishiring - Freelancer? Seeking freelancer?', 'https://news.ycombinator.com/submitted?id=whoishiring')
    return rss.response()
Esempio n. 6
0
def new_comments():
    query = request.args.get('q')
    api = API.using_request(request)
    if query:
        del api.params['restrictSearchableAttributes']
        rss_title = 'Hacker News: "%s" comments' % query
    else:
        rss_title = 'Hacker News: New Comments'
    rss = RSS(api.comments(), rss_title,
              'https://news.ycombinator.com/newcomments')
    return rss.response()
Esempio n. 7
0
def story_comments():
    story_id = request.args.get('id')
    api = API.using_request(request)
    api_response = api.comments(story_id=story_id)

    if api_response['hits']:
        story = api_response['hits'][0]
        rss_title = 'Hacker News: New Comments on "%s"' % story['story_title']
    else:
        rss_title = 'Hacker News: New Comments'

    rss_link = 'https://news.ycombinator.com/item?id=%s' % story_id
    rss = RSS(api_response, rss_title, rss_link)
    return rss.response()
Esempio n. 8
0
def story_comments():
    story_id = request.args.get('id')
    api = API.using_request(request)
    api_response = api.comments(story_id=story_id)

    if api_response['hits']:
        story = api_response['hits'][0]
        rss_title = 'Hacker News: New Comments on "%s"' % story['story_title']
    else:
        rss_title = 'Hacker News: New Comments'

    rss_link = 'https://news.ycombinator.com/item?id=%s' % story_id
    rss = RSS(api_response, rss_title, rss_link)
    return rss.response()
Esempio n. 9
0
def who_is_hiring(include=None):
    api = API.using_request(request)
    if include is None:
        rss = RSS(api.who_is_hiring('all'), 'whoishiring',
                  'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'jobs':
        rss = RSS(api.who_is_hiring(include), 'whoishiring - Who is hiring?',
                  'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'hired':
        rss = RSS(api.who_is_hiring(include),
                  'whoishiring - Who wants to be hired?',
                  'https://news.ycombinator.com/submitted?id=whoishiring')
    elif include == 'freelance':
        rss = RSS(api.who_is_hiring(include),
                  'whoishiring - Freelancer? Seeking freelancer?',
                  'https://news.ycombinator.com/submitted?id=whoishiring')
    return rss.response()
Esempio n. 10
0
def polls():
    api = API.using_request(request)
    rss = RSS(api.polls(), 'Hacker News: Polls')
    return rss.response()
Esempio n. 11
0
def polls():
    api = API.using_request(request)
    rss = RSS(api.polls(), 'Hacker News: Polls')
    return rss.response()
Esempio n. 12
0
def jobs():
    api = API.using_request(request)
    rss = RSS(api.jobs(), 'Hacker News: Jobs',
              'https://news.ycombinator.com/jobs')
    return rss.response()
Esempio n. 13
0
def ask():
    api = API.using_request(request)
    rss = RSS(api.ask_hn(), 'Hacker News: Ask HN',
              'https://news.ycombinator.com/ask')
    return rss.response()
Esempio n. 14
0
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN')
    return rss.response()
Esempio n. 15
0
def frontpage():
    api = API.using_request(request)
    rss_title = 'Hacker News: Front Page'
    rss = RSS(api.frontpage(), rss_title, 'https://news.ycombinator.com/')
    return rss.response()
Esempio n. 16
0
def frontpage():
    api = API.using_request(request)
    rss_title = 'Hacker News: Front Page'
    rss = RSS(api.frontpage(), rss_title, 'https://news.ycombinator.com/')
    return rss.response()
Esempio n. 17
0
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN', 'https://news.ycombinator.com/shownew')
    return rss.response()
Esempio n. 18
0
def jobs():
    api = API.using_request(request)
    rss = RSS(api.jobs(), 'Hacker News: Jobs', 'https://news.ycombinator.com/jobs')
    return rss.response()
Esempio n. 19
0
def ask():
    api = API.using_request(request)
    rss = RSS(api.ask_hn(), 'Hacker News: Ask HN', 'https://news.ycombinator.com/ask')
    return rss.response()
Esempio n. 20
0
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN',
              'https://news.ycombinator.com/shownew')
    return rss.response()
Esempio n. 21
0
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN')
    return rss.response()