コード例 #1
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
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()
コード例 #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()
コード例 #3
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
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()
コード例 #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()
コード例 #5
0
ファイル: hnrss.py プロジェクト: edavis/hnrss
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()
コード例 #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()
コード例 #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()
コード例 #8
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
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()
コード例 #9
0
ファイル: hnrss.py プロジェクト: sjoerdapp/hnrss
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()
コード例 #10
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
def polls():
    api = API.using_request(request)
    rss = RSS(api.polls(), 'Hacker News: Polls')
    return rss.response()
コード例 #11
0
def polls():
    api = API.using_request(request)
    rss = RSS(api.polls(), 'Hacker News: Polls')
    return rss.response()
コード例 #12
0
ファイル: hnrss.py プロジェクト: jaredandrews/hnrss
def jobs():
    api = API.using_request(request)
    rss = RSS(api.jobs(), 'Hacker News: Jobs',
              'https://news.ycombinator.com/jobs')
    return rss.response()
コード例 #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()
コード例 #14
0
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN')
    return rss.response()
コード例 #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()
コード例 #16
0
ファイル: hnrss.py プロジェクト: edavis/hnrss
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()
コード例 #17
0
ファイル: hnrss.py プロジェクト: edavis/hnrss
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN', 'https://news.ycombinator.com/shownew')
    return rss.response()
コード例 #18
0
ファイル: hnrss.py プロジェクト: edavis/hnrss
def jobs():
    api = API.using_request(request)
    rss = RSS(api.jobs(), 'Hacker News: Jobs', 'https://news.ycombinator.com/jobs')
    return rss.response()
コード例 #19
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
def ask():
    api = API.using_request(request)
    rss = RSS(api.ask_hn(), 'Hacker News: Ask HN', 'https://news.ycombinator.com/ask')
    return rss.response()
コード例 #20
0
ファイル: hnrss.py プロジェクト: jaredandrews/hnrss
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN',
              'https://news.ycombinator.com/shownew')
    return rss.response()
コード例 #21
0
ファイル: hnrss.py プロジェクト: lovegandhi/hnrss
def show():
    api = API.using_request(request)
    rss = RSS(api.show_hn(), 'Hacker News: Show HN')
    return rss.response()