Merge lp:~markjtully/gwibber/images-links into lp:gwibber

Proposed by Mark Tully
Status: Merged
Merged at revision: 1327
Proposed branch: lp:~markjtully/gwibber/images-links
Merge into: lp:gwibber
Diff against target: 42 lines (+5/-5)
1 file modified
gwibber/microblog/util/__init__.py (+5/-5)
To merge this branch: bzr merge lp:~markjtully/gwibber/images-links
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+99616@code.launchpad.net

Description of the change

Removed the superfluous 'Image' from tweets in the image stream which used imgpreview() to get their thumbnail

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gwibber/microblog/util/__init__.py'
2--- gwibber/microblog/util/__init__.py 2012-03-20 16:31:03 +0000
3+++ gwibber/microblog/util/__init__.py 2012-03-27 20:56:18 +0000
4@@ -69,7 +69,7 @@
5
6 # If the text is a direct link to a jpg
7 if text.endswith((".jpg", ".gif", ".png", ".bmp")):
8- images.append({"src": text, "url": text})
9+ images.append({"src": text, "url": None})
10 return images
11
12 # For pic.twitter.com images not wrapped in media entities
13@@ -84,7 +84,7 @@
14 end = content.index(':small"><img') + 6
15
16 image = content[start:end]
17- images.append({"src": image, "url": text})
18+ images.append({"src": image, "url": None})
19 return images
20
21 if "instagr.am" in text:
22@@ -93,7 +93,7 @@
23 resp, content = httplib2.Http().request(thumb)
24 thumb = resp["content-location"]
25
26- images.append({"src": thumb, "url": text})
27+ images.append({"src": thumb, "url": None})
28 return images
29
30 thumbre = {
31@@ -149,9 +149,9 @@
32 for r, u in zip(thumbre, thumburi):
33 for match in re.finditer(thumbre[r], text):
34 if r == 'tweetphoto' or r == 'pic.gd' or r == 'moby.to':
35- images.append({"src": thumburi[u].replace('@', match.group(0)) , "url": text})
36+ images.append({"src": thumburi[u].replace('@', match.group(0)) , "url": None})
37 else:
38- images.append({"src": thumburi[u].replace('@', match.group(1)) , "url": text})
39+ images.append({"src": thumburi[u].replace('@', match.group(1)) , "url": None})
40 return images
41
42 def videopreview(text):

Subscribers

People subscribed via source and target branches