File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed
Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/ruby
2+
3+ # Dropzone Destination Info
4+ # Name: Posterous
5+ # Description: Share stuff on Posterous.
6+ # Handles: NSFilenamesPboardType
7+ # Events: Clicked, Dragged
8+ # Creator: Aptonic Software
9+ # URL: http://aptonic.com
10+ # IconURL: http://aptonic.com/destinations/icons/posterous.png
11+ # OptionsNIB: Login
12+ # LoginTitle: Posterous Login Details
13+
14+ require "rexml/document"
15+
16+ def dragged
17+ $dz. determinate ( false )
18+
19+ file_path = $items[ 0 ]
20+
21+ $dz. begin ( "Uploading..." )
22+
23+ output = IO . popen ( "/usr/bin/curl -u #{ ENV [ 'USERNAME' ] } :#{ ENV [ 'PASSWORD' ] } -F 'media=@#{ file_path } ' http://posterous.com/api/newpost 2>&1" ) . read
24+
25+ begin
26+ url = ""
27+ doc = REXML ::Document . new ( output )
28+ root = doc . root
29+ status = root . attributes [ "status" ]
30+
31+ if status == "ok"
32+ doc . elements . each ( "rsp/mediaurl" ) { |e | url = e . text }
33+ else
34+ $dz. error ( "TwitPic Upload Error" , root . elements [ 1 ] . attributes [ "msg" ] )
35+ end
36+
37+ $dz. finish ( "URL is now on clipboard" )
38+ $dz. url ( url )
39+ rescue
40+ $dz. finish ( "Upload Failed" )
41+ $dz. url ( false )
42+ end
43+
44+ end
45+
46+ def clicked
47+ system ( "open http://posterous.com/" )
48+ end
Original file line number Diff line number Diff line change 1+ #!/usr/bin/ruby
2+
3+ # Dropzone Destination Info
4+ # Name: Say Text
5+ # Description: Text dragged onto this destination will be read aloud to you.
6+ # Events: Dragged
7+ # Handles: NSStringPboardType
8+ # Creator: Florian Poeck
9+ # URL: http://macfidelity.de
10+ # IconURL: http://aptonic.com/destinations/icons/say.png
11+
12+ def dragged
13+ system "say \" #{ $items[ 0 ] } \" &"
14+ end
Original file line number Diff line number Diff line change 88# Creator: Paul William
99# URL: http://entropytheblog.com
1010# IconURL: http://aptonic.com/destinations/icons/twitpic.png
11+ # OptionsNIB: Login
12+ # LoginTitle: Twitter Login Details
1113
1214require "rexml/document"
1315
You can’t perform that action at this time.
0 commit comments