Welcome, guest! Login / Register - Why register?
[email protected] webmail now available. Want one? Go here.
Windows getting boring or just want to try something Open Source for your next Desktop Environment?! Go Zorin OS.

Paste

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