Skip to content

Commit

Permalink
delete turn image to grey function
Browse files Browse the repository at this point in the history
  • Loading branch information
thesues committed May 25, 2011
1 parent 8a56e99 commit 73cce3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
fetch http://www.newsmth.org top10 and some replies every day
and send mobi files to web users

水木的十大的rss只有标题,每次用kindle看水木的十大的时候,都看不到回复, 用django建立一个网站,支持用户注册每天接收水木十大。会根据用户的需求 推送十大到注册用户的kindle上
计划上可以推送更多的东西,如果有的网站的rss不是全文的,可以自己写html的parser解析出自己需要的东西, 进一步的计划是去parser糗事百科的html,因为糗事百科的rss只有top10,没有每日逐条的。
2 changes: 1 addition & 1 deletion smthtop10/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __str__(self):
class UserProfile(models.Model):
kindlemail=models.EmailField(max_length=75)
user=models.ForeignKey(User,unique=True)
updateTime=models.IntegerField(choices=UPDATE_TIME)
updateTime=models.IntegerField(choices=UPDATE_TIME,default=0)
def __unicode__(self):
return unicode(self.user.username)

Expand Down
5 changes: 3 additions & 2 deletions smthtop10/util/down_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def down_image(smth,url,archive):
os.mkdir(archive+"/images/")
imageData=smth.get_url_data(url)
try:
im=Image.open(StringIO(imageData)).convert("L")
#resize
#im=Image.open(StringIO(imageData)).convert("L")
im=Image.open(StringIO(imageData))
#resize
width,height=im.size
im2=im.resize((width/2,height/2),Image.ANTIALIAS)
im2.save(localimage)
Expand Down
2 changes: 0 additions & 2 deletions urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@

urlpatterns+=patterns("",
(r"^media/(?P<path>.*)$","django.views.static.serve",{'document_root':settings.MEDIA_ROOT}),)


0 comments on commit 73cce3f

Please sign in to comment.