Compare commits
2 Commits
ca78a6d7a9
...
9a279d44b1
Author | SHA1 | Date | |
---|---|---|---|
9a279d44b1 | |||
e506804666 |
|
@ -64,8 +64,11 @@ def get_article(url):
|
|||
|
||||
def get_content_type(url):
|
||||
try:
|
||||
headers = {'User-Agent': 'Twitterbot/1.0'}
|
||||
return requests.get(url, headers=headers, timeout=2).headers['content-type']
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
|
||||
'X-Forwarded-For': '66.249.66.1',
|
||||
}
|
||||
return requests.get(url, headers=headers, timeout=5).headers['content-type']
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
|
@ -57,15 +57,15 @@ class Feed extends React.Component {
|
|||
{error && <p>Connection error?</p>}
|
||||
{stories ?
|
||||
<div>
|
||||
{stories.map((x, i) =>
|
||||
<div className='item' key={i}>
|
||||
{stories.map(x =>
|
||||
<div className='item' key={x.id}>
|
||||
<div className='title'>
|
||||
<Link className='link' to={'/' + x.id}>
|
||||
<img className='source-logo' src={logos[x.source]} alt='source logo' /> {x.title}
|
||||
</Link>
|
||||
|
||||
<span className='source'>
|
||||
​({sourceLink(x)})
|
||||
({sourceLink(x)})
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -64,15 +64,15 @@ class Results extends React.Component {
|
|||
<p>Search results:</p>
|
||||
<div className='comment lined'>
|
||||
{stories.length ?
|
||||
stories.map((x, i) =>
|
||||
<div className='item' key={i}>
|
||||
stories.map(x =>
|
||||
<div className='item' key={x.id}>
|
||||
<div className='title'>
|
||||
<Link className='link' to={'/' + x.id}>
|
||||
<img className='source-logo' src={logos[x.source]} alt='source logo' /> {x.title}
|
||||
</Link>
|
||||
|
||||
<span className='source'>
|
||||
​({sourceLink(x)})
|
||||
({sourceLink(x)})
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user