mirror of
https://github.com/Chouchen/tumblr2shaarli.git
synced 2018-06-06 17:22:06 +02:00
Reorganise le code et ajoute la doc
This commit is contained in:
parent
18f9d44410
commit
869c57b7f3
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea
|
18
README.md
Normal file
18
README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Tumblr2Shaarli
|
||||||
|
|
||||||
|
This project is just about saving your tumblr into a shaarli instance (new or used)
|
||||||
|
|
||||||
|
## Why?
|
||||||
|
|
||||||
|
Because I don't use Tumblr anymore, but used it a lot to bookmark and wanted to save it, self-hosted style.
|
||||||
|
|
||||||
|
I don't want to be dependant of an app anymore.
|
||||||
|
|
||||||
|
And Tumblr's API is easy to use, so, why not?
|
||||||
|
|
||||||
|
## How?
|
||||||
|
|
||||||
|
See the doc in [english](docs/EN.md)
|
||||||
|
|
||||||
|
Voir la documentation en [français](docs/FR.md)
|
||||||
|
|
33
docs/EN.md
Normal file
33
docs/EN.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Install and use this script
|
||||||
|
|
||||||
|
1. Copy the content of `src` into your shaarli instance (at its root with index.php)
|
||||||
|
2. Copy `tumblr.ini.dev` to `tumblr.ini`
|
||||||
|
3. Fill the `tumblr.ini`'s variables
|
||||||
|
|
||||||
|
```ini
|
||||||
|
tumblr = xxx.tumblr.com # your tumblr URL (can be another domain if you paid for it)
|
||||||
|
api_key = xxx # your tumblr's API key (see below)
|
||||||
|
private = true # if links should be private or public
|
||||||
|
shaarli_dir = # leave blank if you followed this tutorial, else, the path to shaarli
|
||||||
|
```
|
||||||
|
4. Check if you got write right on the folder containing `import.php`
|
||||||
|
5. Launch : via browser or via command line
|
||||||
|
|
||||||
|
### Tumblr API key
|
||||||
|
|
||||||
|
You need to register an app in tumblr :
|
||||||
|
|
||||||
|
1. Log in your tumblr account
|
||||||
|
2. Go to https://www.tumblr.com/oauth/apps
|
||||||
|
3. Click `Register an application`
|
||||||
|
4. Fill all mandatory fields + `website` (even if it's not marked as mandatory, trust me, it is)
|
||||||
|
5. You got it ! **OAuth Consumer Key** !
|
||||||
|
6. Tips : you can find it again in https://www.tumblr.com/settings/apps
|
||||||
|
|
||||||
|
|
||||||
|
### Limitations
|
||||||
|
|
||||||
|
Tumblr's API can *only* retrieve 20 × 250 posts (I did the math, it's 5000)
|
||||||
|
|
||||||
|
This script does not resume import, so if you got more than 5k posts, it won't work.
|
||||||
|
|
32
docs/FR.md
Normal file
32
docs/FR.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Installer et utiliser ce script
|
||||||
|
|
||||||
|
1. Copier le contenu de `src` dans votre instance Shaarli (à sa racine où il y a `index.php`)
|
||||||
|
2. Copier `tumblr.ini.dev` vers `tumblr.ini`
|
||||||
|
3. Remplir les variables de `tumblr.ini`
|
||||||
|
|
||||||
|
```ini
|
||||||
|
tumblr = xxx.tumblr.com # l'URL de votre tumblr (ça peut être un autre domaine si vous avez payé)
|
||||||
|
api_key = xxx # votre clef d'API tumblr (voir ci-dessous)
|
||||||
|
private = true # indique si les liens importés seront privés ou publiques
|
||||||
|
shaarli_dir = # laisser vide si vous avez suivi ce tuto, sinon, le chemin vers votre instance shaarli
|
||||||
|
```
|
||||||
|
4. Vérifier si vous avez les droits en écriture sur la base (datastore.php) et le dossier ou se trouve `import.php`
|
||||||
|
5. Lancer le script via votre navigateur ou par ligne de commande
|
||||||
|
|
||||||
|
### La clef d'API Tumblr
|
||||||
|
|
||||||
|
Vous avez besoin d'enrigistrer une app Tumblr :
|
||||||
|
|
||||||
|
1. Connectez vous sur votre compte tumblr
|
||||||
|
2. Allez sur https://www.tumblr.com/oauth/apps
|
||||||
|
3. Cliquez sur `Enregistrer une application`
|
||||||
|
4. Remplissez tous les champs obligatoires + `website` (même si c'est pas marqué obligatoire, ça l'est)
|
||||||
|
5. Vous l'avez votre clef ! **Clé du client (OAuth)** !
|
||||||
|
6. Astuce : vous pouvez la retrouver ici : https://www.tumblr.com/settings/apps
|
||||||
|
|
||||||
|
|
||||||
|
### Limitations
|
||||||
|
|
||||||
|
L'API de Tumblr ne peut récupérer *que* 20 × 250 posts (J'ai calculé, ça fait 5000)
|
||||||
|
|
||||||
|
Ce script ne permet pas de *compléter* un import depuis un post précis, donc si vous avez plus de 5k posts, ça ne fonctionnera pas (enfin, vous n'aurez pas tout)
|
1
src/vendor/bin/html-to-markdown
vendored
Normal file
1
src/vendor/bin/html-to-markdown
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
../league/html-to-markdown/bin/html-to-markdown
|
0
vendor/league/html-to-markdown/bin/html-to-markdown → src/vendor/league/html-to-markdown/bin/html-to-markdown
vendored
Executable file → Normal file
0
vendor/league/html-to-markdown/bin/html-to-markdown → src/vendor/league/html-to-markdown/bin/html-to-markdown
vendored
Executable file → Normal file
1
vendor/bin/html-to-markdown
vendored
1
vendor/bin/html-to-markdown
vendored
@ -1 +0,0 @@
|
|||||||
../league/html-to-markdown/bin/html-to-markdown
|
|
Loading…
Reference in New Issue
Block a user