Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Bash by registered user uwe ( 13 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

Your Name: Code Language: