| 2008-06-19, 05:19 AM | #46 |
|
Member
![]() Registered: Apr 2003
My Mac: PB G4 15-inch FW800 Super drive/iSight/PB1400C/IPod Shuffle
Posts: 40
오프라인
|
__________________
잘먹고 잘살자! |
|
| 2008-06-20, 01:16 AM | #47 |
|
New Member
Registered: Feb 2004
My Mac: PowerBook 15" (M8981KH/A)
Posts: 8
오프라인
|
__________________
blog.dahlia.pe.kr |
|
| 2008-06-20, 06:06 AM | #48 |
|
Member
![]() Registered: Jan 2008
My Mac: MacBook
Posts: 27
온라인
|
설치 방법도 거의 똑같습니다. 1. 아래에서 user_account,user_key를 자신의 계정 정보를 이용하여 설정 한 후 ~/Library/Application Support/Quicksilver/Actions 디렉토리에 me2day.scpt 로 저장(디렉토리가 없으면 생성 후 저장) Code:
using terms from application "Quicksilver"
on process text me2day
set wordcount to do shell script "echo " & quoted form of me2day & " | wc -c"
set wordcount to do shell script "echo " & quoted form of wordcount & " | sed 's/^[ ]*//'"
if wordcount as integer > 140 then
my growlRegister()
growlNotify("me2day too long", "(" & wordcount & ") characters")
return nothing
end if
set user_account to "xxxxxx"
-- you can get user_key from http://me2day.net/"user_account"/settings/basic
set user_key to "xxxxxxxx"
set results to do shell script "/usr/local/bin/create_post.py " & user_account & " " & user_key & " " & quoted form of me2day
-- display dialog results
my growlRegister()
growlNotify("me2day Sent", me2day)
end process text
end using terms from
using terms from application "GrowlHelperApp"
-- Register Growl
on growlRegister()
tell application "GrowlHelperApp"
register as application "me2day" all notifications {"Alert"} default notifications {"Alert"}
end tell
end growlRegister
-- Notify using Growl
-- Example: growlNotify("This is an Alert","This is a test of the Growl Alert System")
on growlNotify(grrTitle, grrDescription)
tell application "GrowlHelperApp"
notify with name "Alert" title grrTitle description grrDescription application name "me2day"
end tell
end growlNotify
end using terms from
sudo cp create_post.py /usr/local/bin/. sudo chmod 755 /usr/local/bin/create_post.py Code:
#!/usr/bin/env python
import sys, hashlib, urllib;
def main():
if len(sys.argv) < 4:
print """Usage: %s user_id user_key message
user_id - user id
user_key - user key
message - 'message text'
"""%sys.argv[0]
return 1
user_id = sys.argv[1]
user_key = sys.argv[2]
msg = sys.argv[3]
# app_key is provided by me2day
app_key = '58586653f1e1fdf987cbd6955f078107'
create_url = 'http://me2day.net/api/create_post/' + user_id
try:
key_append = "81036618"
# ukey format = 8 num key_append(arbitary) + md5(key_append + user_key)
user_key_md5 = key_append + hashlib.md5(key_append + user_key).hexdigest()
#print user_key_md5
# refer to http://codian.springnote.com/pages/164476
#tag can be added by ('post[tags]', tag)
query = urllib.urlencode([('uid',user_id),('ukey',user_key_md5),('akey',app_key),('post[body]',msg)])
result = urllib.urlopen(create_url + '?' + query)
print result.info()
return 0
except:
# print "-------------"
return 1
if __name__ == "__main__":
sys.exit(main())
quicksilver 창을 띄운 후, "." + 내용 입력 후, tab, me2day 저의 경우에는 . 을 입력 후 한영 변환을 두번해야 한글 입력이 되고 영어로 변환을 할 때도 두번 변환을 해줘야 되는 큰 불편함이 있네요^^;; 이 기능이 필요하신 분은 사용을 해보시기 바랍니다. mrhjkim 님께서 2008-06-20 06:20 AM 에 수정하셨습니다.. 이유: display dialog 삭제 |
|
| 2008-06-26, 01:43 PM | #49 |
|
Member
![]() Registered: Aug 2007
My Mac: new iMac C2D 20"
Posts: 50
오프라인
|
__________________
교육이 바로 서야 나라가 바로 섭니다! |
|