Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted as Bash by registered user uwe ( 14 years ago )
#!/bin/bash
## Trakt
trakt_user="xxx"
trakt_pass="sha1(xxx)"
trakt_api="xxx"
trakt_url="http://api.trakt.tv/movie/library/$trakt_api"
title="$(echo "$3" | sed 's/ (.*//')"
year="$(echo "$3" | sed 's/^.* (\([0-9]*\)).*/\1/')"
if [ "$title" == "$3" ]; then
title="$(echo "$3" | sed 's/\./ /g;s/ 20.*//')"
year="$(echo "$3" | sed 's/^.*\.20\([0-9][0-9]\).*/20\1/')"
fi
echo -n "$3 [$title ($year)]: "
echo '
{
"username": "'"$trakt_user"'",
"password": "'"$trakt_pass"'",
"movies": [
{
"imdb_id": "",
"title": "'"$title"'",
"year": '$year'
}
]
}' | curl -s --data-binary @- "$trakt_url"
echo
Revise this Paste