def scan(self): dat = loader.json( 'https://www.rockstargames.com/newswire/get-posts.json?page=1&tag_id=591') posts = dat['posts'] for a in posts: _title = loader.direct_soup(a['title']).get_text() _url = a['link'] _desc = loader.direct_soup(a['blurb']).get_text() _image = None if 'preview_images_parsed' in a and 'featured' in a['preview_images_parsed']: _image = a['preview_images_parsed']['featured']['src'] yield Update(game=self, update_name=_title, post_url=_url, desc=_desc, color="#588622", image=_image)
def scan(self): data = loader.json( "http://services.runescape.com/m=news/latestNews.json?cat=1" )['newsItems'] for p in data: _title = p['title'] _url = p['link'] _desc = p['summary'] _img = p['summaryImageLink'] yield Update(game=self, update_name=_title, post_url=_url, desc=_desc, color='#f8ca40', image=_img)
def scan(self): soup = loader.json( 'https://playhearthstone.com/en-us/api/blog/articleList/?page=1&pageSize=12&tagsList[]=patch' ) for upd in soup: title = upd['title'] desc = upd['summary'] img = 'https:' + upd['thumbnail']['url'] url = upd['defaultUrl'] yield Update(game=self, update_name=title, post_url=url, desc=desc, color="#6785c2", image=img)
def scan(self): encoded = loader.json( 'https://news.blizzard.com/en-us/blog/list?pageNum=1&pageSize=30&community=heroes-of-the-storm' ) soup = loader.direct_soup(encoded['html']) elems = soup.find_all(attrs={'class': 'ArticleListItem'}) for elem in elems: a = elem.find('a') dsc = elem.find(attrs={"class": 'ArticleListItem-description'}) title = elem.find(attrs={'class': 'ArticleListItem-title'}) _url = 'https://news.blizzard.com/' + a['href'] _title = title.text _desc = dsc.text yield Update(game=self, update_name=_title, post_url=_url, desc=_desc, color="#632004")
def scan(self): data = loader.json( "https://prod-tridionservice.ubisoft.com/live/v1/News/Latest?pageSize=6&pageIndex=0" "&language=en-US&templateId=tcm%3A152-76778-32&detailPageId=tcm%3A150-194572-64" "&keywordList=233416&useSeoFriendlyUrl=true")[ 'items'] # Returns XML for p in data: soup = loader.direct_soup(p['Content']) _img = soup.find('img')['src'] _title = soup.find('h3').text _desc = soup.find('strong').text _url = 'https://rainbow6.ubisoft.com/' + soup.find('a')['href'] yield Update(game=self, update_name=_title, post_url=_url, desc=_desc, color='#333740', image=_img)
def scan(self): dat = loader.json( 'https://www.rockstargames.com/newswire/get-posts.json?tags=716&page=1' ) posts = dat['posts'] for a in posts: _title = a['title'].split('<')[0] _url = a['link'] _desc = a['blurb'].split('<')[0].replace('\n\n', '\n').replace( '\n\n', '\n') _image = None if 'preview_images_parsed' in a and 'featured' in a[ 'preview_images_parsed']: _image = a['preview_images_parsed']['featured']['src'] yield Update(game=self, update_name=_title, post_url=_url, desc=_desc, color="#588622", image=_image)