aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2011-06-08 20:16:36 -0400
committerWojciech Polak <polak@gnu.org>2011-06-08 20:16:36 -0400
commit41894679a53c88a0a9164d43f354d456cf5e8158 (patch)
treef22a4394379d2578a66aeff6895ab23787a4e9e6
parent7f33cd3058f8f4756d1a02eec79de8f5392b5620 (diff)
downloadglifestream-41894679a53c88a0a9164d43f354d456cf5e8158.tar.gz
glifestream-41894679a53c88a0a9164d43f354d456cf5e8158.tar.bz2
Expand Instagram and Lockerz.
-rw-r--r--filters/expand.py14
-rw-r--r--static/js/glifestream.js12
2 files changed, 19 insertions, 7 deletions
diff --git a/filters/expand.py b/filters/expand.py
index b5042bf..d2188c0 100644
--- a/filters/expand.py
+++ b/filters/expand.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2009, 2010 Wojciech Polak
+# gLifestream Copyright (C) 2009, 2010, 2011 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -52,11 +52,16 @@ def __sp_twitpic (m):
(m.group (2), m.group (3)), downscale=True)
return __gen_tai (m.group (0), url)
-def __sp_plixi (m):
- url = media.save_image ('http://api.plixi.com/api/tpapi.svc/imagefromurl?size=medium&url=http://plixi.com/p/%s' %
+def __sp_lockerz (m):
+ url = media.save_image ('http://api.plixi.com/api/tpapi.svc/imagefromurl?size=mobile&url=http://lockerz.com/s/%s' %
(m.group (1)), downscale=True)
return __gen_tai (m.group (0), url)
+def __sp_instagram (m):
+ url = media.save_image ('http://%s/p/%s/media/?size=t' %
+ (m.group (1), m.group (2)), downscale=True)
+ return __gen_tai (m.group (0), url)
+
def __sp_yfrog (m):
url = media.save_image ('http://%s/%s:iphone' %
(m.group (1), m.group (2)), downscale=True)
@@ -82,7 +87,8 @@ def __sp_imgloc (m):
def shortpics (s):
"""Expand short picture-URLs."""
s = re.sub (r'http://(www\.)?(twitpic\.com)/(\w+)', __sp_twitpic, s)
- s = re.sub (r'http://plixi\.com/p/(\d+)', __sp_plixi, s)
+ s = re.sub (r'http://lockerz\.com/s/(\d+)', __sp_lockerz, s)
+ s = re.sub (r'http://(instagr\.am)/p/(\w+)/?', __sp_instagram, s)
s = re.sub (r'http://(yfrog\.com)/(\w+)', __sp_yfrog, s)
s = re.sub (r'http://(www\.)?brizzly\.com/pic/(\w+)', __sp_brizzly, s)
s = re.sub (r'http://(www\.)?flickr\.com/([\w\.\-/]+)', __sp_flickr, s)
diff --git a/static/js/glifestream.js b/static/js/glifestream.js
index 465bf3b..59906fa 100644
--- a/static/js/glifestream.js
+++ b/static/js/glifestream.js
@@ -1,5 +1,5 @@
/*
- * gLifestream Copyright (C) 2009, 2010 Wojciech Polak
+ * gLifestream Copyright (C) 2009, 2010, 2011 Wojciech Polak
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -1223,9 +1223,14 @@
href = 'http://twitpic.com/show/full/' + RegExp.$1;
type = 'image';
}
- else if (href.match (/plixi\.com\/p\/(\d+)/) ||
+ else if (href.match (/lockerz\.com\/s\/(\d+)/) ||
+ href.match (/plixi\.com\/p\/(\d+)/) ||
href.match (/tweetphoto\.com\/(\d+)/)) {
- href = 'http://api.plixi.com/api/tpapi.svc/imagefromurl?size=big&url=http://plixi.com/p/' + RegExp.$1;
+ href = 'http://api.plixi.com/api/tpapi.svc/imagefromurl?size=big&url=http://lockerz.com/s/' + RegExp.$1;
+ type = 'image';
+ }
+ else if (href.match (/instagr\.am\/p\/(\w+)\/?/)) {
+ href = 'http://instagr.am/p/'+ RegExp.$1 +'/media/?size=l';
type = 'image';
}
else if (href.match (/yfrog\.com\/(\w+)/)) {
@@ -1272,6 +1277,7 @@
$.fancybox (imgs, {
type: type,
index: index,
+ centerOnScroll: true,
overlayColor: 'black',
overlayOpacity: 0.8,
padding: 2,

Return to:

Send suggestions and report system problems to the System administrator.