Re: 将 paste-img 改得更加 KISS
发表于 : 2011-07-01 10:43
对不去irc的来说一点用都没 

这个还真是eexpress 写了:这都干嘛呢。贴图,irc经常用的啊。
截图贴图组合用。文件管理器右键贴图。方便嘛。
代码: 全选
#!usr/bin/python
# 打开
with open(__import__("sys").stdin.read(), "r+b") as fi: content = __import__("base64").b64encode(fi.read());
# 上传
fw = __import__("urllib2").urlopen("http://api.imgur.com/2/upload", __import__("urllib").urlencode({"key" : "XXX", "image" : content,}));
# 输出
print (__import__("re").search("\<original\>(.*)\<\/original\>", fw.read())).group(1); fw.close();
● pasteimg.pl -h
NAME
paste-img - Paste image to serval web hosts
SYNOPSIS
paste-img [OPTION]... [IMAGE_FILE]...
OPTION
-s, --select
Select web host name. Can use short name as key word, such as "kimag" could refer to "kimag.es". All avoid host names can be list by using "-l".
-l, --list
List all hosts name avoid.
-h, --help
This help.
-n, --name
Nick name send to web host if support. default name is your login id name.
AUTHOR
Written by eexpress ([email protected]).
photor 写了:nmsfan 写了:贴图哦
不知道有啥用
![]()
代码: 全选
● diff pasteimg.pl deb/usr/bin/pasteimg.pl
40,42d39
< use Net::DBus;
< $bus = Net::DBus->session->get_service('org.freedesktop.Notifications')
< ->get_object('/org/freedesktop/Notifications','org.freedesktop.Notifications');
46d42
< $bus->Notify("paste-img", 0, "info", "准备截图", "光标改变后,使用鼠标截图。。。", [], { }, -1);
51a48,50
> use Net::DBus;
> $bus = Net::DBus->session->get_service('org.freedesktop.Notifications')
> ->get_object('/org/freedesktop/Notifications','org.freedesktop.Notifications');
还是重写吧eexpress 写了:代码: 全选
● diff pasteimg.pl deb/usr/bin/pasteimg.pl 40,42d39 < use Net::DBus; < $bus = Net::DBus->session->get_service('org.freedesktop.Notifications') < ->get_object('/org/freedesktop/Notifications','org.freedesktop.Notifications'); 46d42 < $bus->Notify("paste-img", 0, "info", "准备截图", "光标改变后,使用鼠标截图。。。", [], { }, -1); 51a48,50 > use Net::DBus; > $bus = Net::DBus->session->get_service('org.freedesktop.Notifications') > ->get_object('/org/freedesktop/Notifications','org.freedesktop.Notifications');
哎,算了.我alias了ChenFengyuan 写了:求只截图不上传的参数!!!!