예제 #1
0
 def crawl_links():
     payload = {
         'project': 'NeoScrapy',
         'spider': 'bitcointalk',
         'func': 'ANNLINK'
     }
     return scrapy_add_job(payload).json()
 def crawl_currency_total_market():
     """
     请求总市值的接口
     :param self:
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'coinmarketcap',
         'func': 'TOTAL_MARKET'
     }
     return scrapy_add_job(payload).json()
예제 #3
0
 def crawl_user_info(user_id):
     """
     获取用户的基本信息、统计信息
     :param user_id: 用户的id
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'bitcointalk',
         'ids': user_id,
         'func': 'USER'
     }
     return scrapy_add_job(payload).json()
예제 #4
0
 def crawl_reddit_subreddit(srname):
     """
     获取subreddit的基本信息
     :param srname:
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'reddit',
         'func': 'SUBREDDIT',
         'srname': srname
     }
     return scrapy_add_job(payload).json()
예제 #5
0
 def crawl_reddit_link(srname):
     """
     根据subreddit name获取该话题下的帖子信息
     :param srname:
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'reddit',
         'func': 'LINK',
         'srname': srname
     }
     return scrapy_add_job(payload).json()
 def crawl_currency_history_price(currency_id):
     """
     根据currency_id获取currency的历史价格信息
     :param self:
     :param currency_id: 货币id
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'coinmarketcap',
         'func': 'HISTORY_PRICE',
         'currency_id': currency_id
     }
     return scrapy_add_job(payload).json()
 def crawl_currency_detail(with_logo=False):
     """
     通过网页爬取currency的基本信息,如网址,reddit地址的等信息
     :param self:
     :param with_logo: true则会爬取currency的logo图片
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'coinmarketcap',
         'func': 'DETAIL',
         'with_logo': with_logo
     }
     return scrapy_add_job(payload).json()
예제 #8
0
 def crawl_reddit_comment(srname, force=False):
     """
     根据subreddit name获取该话题最近一个月帖子的评论
     :param srname:
     :param force: force为false时默认获取最近一个月的帖子下的评论。force为true时强制获取所有时间内帖子的评论。
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'reddit',
         'func': 'COMMENT',
         'srname': srname,
         'force': force
     }
     return scrapy_add_job(payload).json()
예제 #9
0
 def crawl_project(full_name, with_user=False):
     """
     根据GitHub project的full name获取项目的信息
     :param full_name:
     :param with_user: 是否爬取该项目的贡献者信息,由于请求该接口花费时间较长,并且实时性要求不高。可以间隔较长的时间请求一次。
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'github',
         'func': 'PROJECT',
         'full_name': full_name,
         'with_user': with_user
     }
     return scrapy_add_job(payload).json()
예제 #10
0
 def crawl_ann_link_comment(link_id, force=False):
     """
     获取单个bitcointalk中帖子下的所有评论
     :param self:
     :param link_id: bitcointalk中的帖子的topic_id ,对应payload中的ids *ids不是数组。
     :param force: 是否强制获取所有时间内的回复,默认为False,即在获取评论的时候会和数据库中已有的最新回复时间做对比,只拿最新的回复
     :return:
     """
     payload = {
         'project': 'NeoScrapy',
         'spider': 'bitcointalk',
         'ids': link_id,
         'func': 'COMMENT',
         'force': force
     }
     return scrapy_add_job(payload).json()
 def crawl_coindesk_news():
     payload = {'project': 'NeoScrapy', 'spider': 'coindesk'}
     return scrapy_add_job(payload).json()