jubishop (owner)

Revisions

gist: 138047 Download_button fork
public
Public Clone URL: git://gist.github.com/138047.git
export.applescript
1
2
3
4
5
6
7
8
9
tell application "iTunes"
copy (convert current track) to newTrack
set newLocation to (location of track 1 of current playlist)
tell application "Finder"
copy (move newLocation to the desktop with replacing) to newFile
end tell
delete (track 1 of current playlist)
do shell script "uptmp " & quote & (POSIX path of newLocation) & quote
end tell
uptmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
 
require 'rubygems'
require 'rbosa'
 
raise "Need file name" if (ARGV.empty?)
 
fileName = ARGV.first
uploadDir = ARGV[1] || (File.extname(fileName) == ".mp3" ? "music" : "tmp")
 
IO.popen("scp '#{fileName}' jubishop@jubishop.com:~/WebServer/public/#{uploadDir}") {|io| io.read }
IO.popen("rm '#{fileName}'") { |io| io.read }
 
safari = OSA.app('Safari')
safari.make OSA::Safari::Document
 
document = safari.documents.last
documents = safari.documents.to_a
 
if (File.extname(fileName) == ".swf")
  document.url = "http://jubishop.com/Flash.html?swf=#{uploadDir}/" +
    File.basename(fileName)
else
  document.url = "http://jubishop.com/#{uploadDir}/" +
    File.basename(fileName)
end
 
safari.activate