Browse files

fix fb if no pic present

  • Loading branch information...
1 parent be62fb4 commit dda0b2ecd925dd413e62af8a247f36d06651125e @mimecuvalo committed Jul 13, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 controllers/facebook.py
View
5 controllers/facebook.py
@@ -61,6 +61,7 @@ def post(self):
+ content_remote.strip_html(view.replace('<br>', ' '))
+ ('\n' if title or view else '')
+ self.get_argument('url'))
+ post_args = {"message": status}
thumb = self.get_argument('thumb', '')
picture = None
@@ -85,7 +86,9 @@ def post(self):
else:
picture = thumb
- post_args = {"message": status, "picture": picture}
+ if picture:
+ post_args['picture'] = picture
+
video = re.compile(r'<iframe[^>]*(youtube|vimeo)[^>]*>.*?</iframe>',
re.M | re.S).search(view)
if video:

0 comments on commit dda0b2e

Please sign in to comment.