property messagePostForm : "http://www.yaronet.com/addMn.php?skin="
property yNLogin : ""
property yNPassword : ""
-- Remplissez ici par le n° du sujet qui va bien. Ici c'est 'kekoutezvous en ce moment'
property yNSujetID : 18
property searchList : {"&", "é", "è", "à", "É", "È", "À", "ç", "©", "®", quote}
property replaceList : {"&;", "é", "è", "à", "É", "È", "¿", "ç", "©", "®", """}
to switchText of t from s to r
set text item delimiters to s
set t to t's text items
set text item delimiters to r
tell t to set t to beginning & ({""} & rest)
t
end switchText
to convertText(t)
set d to text item delimiters
considering case
repeat with n from 1 to count searchList
set t to switchText of t from my searchList's item n to my replaceList's item n
end repeat
end considering
set text item delimiters to d
t
end convertText
tell application "iTunes"
-- Get all information from iTunes
set theTrack to the current track
set theAlbum to the album of theTrack
set theArtist to the artist of theTrack
set theName to the name of theTrack
set theString to "/me is listening to '[i]" & theName & "[/i]' by '[i]" & theArtist & "[/i]' from '[i]" & theAlbum & "[/i]'"
set theString to my convertText(theString)
-- Now publish on yAronet...
set shellCmd to "curl -O /dev/null -F " & quote & "login=" & yNLogin & quote & ¬
" -F " & quote & "mdp=" & yNPassword & quote & ¬
" -F " & quote & "sujetID=" & yNSujetID & quote & ¬
" -F " & quote & "texte=" & theString & quote & ¬
" -F " & quote & "Envoyer=" & quote & ¬
" -F " & quote & "logman=1" & quote & ¬
" -F " & quote & "Ar=1" & quote & " " & messagePostForm
do shell script shellCmd
end tell
J'y ai enlevé quelques bricoles, vous pouvez le personnaliser comme vous voulez, (il manque mon formatage et la mise en place de la pochette
)
Forcement par contre il a pas gardé les ? pour le replace...)
Le voila :
property replaceList : {"& #00038;", "& #00233;", "& #00232;", "& #00224;", "& #00201;", "& #00200;", "& #00191;", "& #00231;", "& #00169;", "& #00174;", "& #00034;"}
suffit de supprimer l'espace entre le & et le #
J'ai été obligé de faire ce remplacement pour eviter des problèmes UTF8->yN

