mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Scraper now dislikes sprite images
This commit is contained in:
@@ -201,6 +201,11 @@ class Scraper:
|
||||
log.debug('ignore dimensions %s' % image_url)
|
||||
continue
|
||||
|
||||
#penalize images with "sprite" in their name
|
||||
if 'sprite' in image_url.lower():
|
||||
log.debug('penalizing sprite %s' % image_url)
|
||||
area /= 10
|
||||
|
||||
if area > max_area:
|
||||
max_area = area
|
||||
max_url = image_url
|
||||
@@ -324,7 +329,7 @@ scrapers = {'youtube.com': YoutubeScraper,
|
||||
'metacafe.com': MetacafeScraper}
|
||||
|
||||
def test():
|
||||
from r2.lib.pool2 import WorkQueue
|
||||
#from r2.lib.pool2 import WorkQueue
|
||||
jobs = []
|
||||
f = open('/tmp/testurls.txt')
|
||||
for url in f:
|
||||
|
||||
@@ -765,7 +765,7 @@ a.star { text-decoration: none; color: #ff8b60 }
|
||||
.linkcompressed .score.likes { color: #FF8B60; }
|
||||
.linkcompressed .score.dislikes { color: #9494FF; }
|
||||
.linkcompressed .rank {
|
||||
margin-top: 2px;
|
||||
margin-top: 3px;
|
||||
float:left;
|
||||
color: #c6c6c6;
|
||||
font-family: arial;
|
||||
@@ -780,7 +780,7 @@ a.star { text-decoration: none; color: #ff8b60 }
|
||||
.linkcompressed .entry .buttons li.first {padding-left: .5em;}
|
||||
.linkcompressed .entry .buttons li a {
|
||||
padding: 0 2px;
|
||||
background-color: #f1f1f1;
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user