Use entities/urls in open command
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 31 Jul 2015 06:10:39 +0000 (15:10 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 31 Jul 2015 06:15:25 +0000 (15:15 +0900)
docs/conf.py
rainbowstream/c_image.py
rainbowstream/rainbow.py
setup.py

index ead3ddf9094d2e11c6ee732cc811f4f20f8ee9df..b5aaf71c5d0732d647d716e6e8f56e1fd21bc3bb 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '1.2.8'
+version = '1.2.9'
 # The full version, including alpha/beta/rc tags.
-release = '1.2.8'
+release = '1.2.9'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index f26cfcf1c5a471cc33300f9dcf2b84677a22de7f..75787532890f68f5165e580177805e71cb4244cf 100644 (file)
@@ -83,14 +83,6 @@ def image_to_display(path, start=None, length=None):
             block_print(p1, p0)
         sys.stdout.write('\n')
 
-    # Old code for display one pixel on one terminal block
-    # for y in xrange(height):
-    #     sys.stdout.write(' ' * start)
-    #     for x in xrange(width):
-    #         p = i.getpixel((x, y))
-    #         pixel_print(p)
-    #     sys.stdout.write('\n')
-
 
 """
 For direct using purpose
index ba91268d0db72e0c0f9e038a0462143a676361e0..578754f12ce6ae0ba83f83a01a352e2234059d66 100644 (file)
@@ -651,14 +651,14 @@ def urlopen():
             return
         tid = c['tweet_dict'][int(g['stuff'])]
         tweet = t.statuses.show(id=tid)
-        link_prefix = ('http://', 'https://')
-        link_ary = [u for u in tweet['text'].split()
-                    if u.startswith(link_prefix)]
-        if not link_ary:
+        urls = tweet['entities']['urls']
+        if not urls:
             printNicely(light_magenta('No url here @.@!'))
             return
-        for link in link_ary:
-            webbrowser.open(link)
+        else:
+            for url in urls:
+                expanded_url = url['expanded_url'] 
+                webbrowser.open(expanded_url)
     except:
         debug_option()
         printNicely(red('Sorry I can\'t open url in this tweet.'))
@@ -1734,16 +1734,6 @@ def quit():
     sys.exit()
 
 
-def changelog_notify():
-    # For v1.2.8. Hardcoded here but will improve later
-    notice = light_yellow('Hey! RS just ')
-    notice += light_green('doubled ')
-    notice += light_yellow('pixels for higher image resolution. Upgrade and try')
-    notice += light_green(' -iot ')
-    notice += light_yellow('and you will like it for sure :)')
-    printNicely(notice)
-
-
 def reset():
     """
     Reset prefix of line
@@ -1753,8 +1743,6 @@ def reset():
             printNicely(red('Your ~/.rainbow_config.json is messed up:'))
             printNicely(red('>>> ' + c['USER_JSON_ERROR']))
             printNicely('')
-        if not g['using_latest']:
-            changelog_notify()
         printNicely(magenta('Need tips ? Type "h" and hit Enter key!'))
     g['reset'] = False
     try:
index cab2f3ab303f98e67978bd5aaed3122ca4ecd76c..9a28b1ed62adf4074dc2116d2faefefcbc4deebf 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '1.2.8'
+version = '1.2.9'
 
 # Require
 install_requires = [