Ver código fonte

Reorganise le code et ajoute la doc

master
Shikiryu 3 anos atrás
pai
commit
869c57b7f3
45 arquivos alterados com 85 adições e 1 exclusões
  1. +1
    -0
      .gitignore
  2. +18
    -0
      README.md
  3. +33
    -0
      docs/EN.md
  4. +32
    -0
      docs/FR.md
  5. +0
    -0
      src/composer.json
  6. +0
    -0
      src/import.php
  7. +0
    -0
      src/tumblr.ini.dev
  8. +0
    -0
      src/vendor/autoload.php
  9. +1
    -0
      src/vendor/bin/html-to-markdown
  10. +0
    -0
      src/vendor/composer/ClassLoader.php
  11. +0
    -0
      src/vendor/composer/LICENSE
  12. +0
    -0
      src/vendor/composer/autoload_classmap.php
  13. +0
    -0
      src/vendor/composer/autoload_namespaces.php
  14. +0
    -0
      src/vendor/composer/autoload_psr4.php
  15. +0
    -0
      src/vendor/composer/autoload_real.php
  16. +0
    -0
      src/vendor/composer/installed.json
  17. +0
    -0
      src/vendor/league/html-to-markdown/CHANGELOG.md
  18. +0
    -0
      src/vendor/league/html-to-markdown/CONDUCT.md
  19. +0
    -0
      src/vendor/league/html-to-markdown/LICENSE
  20. +0
    -0
      src/vendor/league/html-to-markdown/README.md
  21. +0
    -0
      src/vendor/league/html-to-markdown/bin/html-to-markdown
  22. +0
    -0
      src/vendor/league/html-to-markdown/composer.json
  23. +0
    -0
      src/vendor/league/html-to-markdown/src/Configuration.php
  24. +0
    -0
      src/vendor/league/html-to-markdown/src/ConfigurationAwareInterface.php
  25. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
  26. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/CommentConverter.php
  27. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/ConverterInterface.php
  28. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php
  29. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/DivConverter.php
  30. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/EmphasisConverter.php
  31. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
  32. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php
  33. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/HorizontalRuleConverter.php
  34. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/ImageConverter.php
  35. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/LinkConverter.php
  36. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/ListBlockConverter.php
  37. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
  38. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php
  39. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php
  40. +0
    -0
      src/vendor/league/html-to-markdown/src/Converter/TextConverter.php
  41. +0
    -0
      src/vendor/league/html-to-markdown/src/Element.php
  42. +0
    -0
      src/vendor/league/html-to-markdown/src/ElementInterface.php
  43. +0
    -0
      src/vendor/league/html-to-markdown/src/Environment.php
  44. +0
    -0
      src/vendor/league/html-to-markdown/src/HtmlConverter.php
  45. +0
    -1
      vendor/bin/html-to-markdown

+ 1
- 0
.gitignore Ver arquivo

@@ -0,0 +1 @@
.idea

+ 18
- 0
README.md Ver arquivo

@@ -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
- 0
docs/EN.md Ver arquivo

@@ -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
- 0
docs/FR.md Ver arquivo

@@ -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)

composer.json → src/composer.json Ver arquivo


import.php → src/import.php Ver arquivo


tumblr.ini.dev → src/tumblr.ini.dev Ver arquivo


vendor/autoload.php → src/vendor/autoload.php Ver arquivo


+ 1
- 0
src/vendor/bin/html-to-markdown Ver arquivo

@@ -0,0 +1 @@
../league/html-to-markdown/bin/html-to-markdown

vendor/composer/ClassLoader.php → src/vendor/composer/ClassLoader.php Ver arquivo


vendor/composer/LICENSE → src/vendor/composer/LICENSE Ver arquivo


vendor/composer/autoload_classmap.php → src/vendor/composer/autoload_classmap.php Ver arquivo


vendor/composer/autoload_namespaces.php → src/vendor/composer/autoload_namespaces.php Ver arquivo


vendor/composer/autoload_psr4.php → src/vendor/composer/autoload_psr4.php Ver arquivo


vendor/composer/autoload_real.php → src/vendor/composer/autoload_real.php Ver arquivo


vendor/composer/installed.json → src/vendor/composer/installed.json Ver arquivo


vendor/league/html-to-markdown/CHANGELOG.md → src/vendor/league/html-to-markdown/CHANGELOG.md Ver arquivo


vendor/league/html-to-markdown/CONDUCT.md → src/vendor/league/html-to-markdown/CONDUCT.md Ver arquivo


vendor/league/html-to-markdown/LICENSE → src/vendor/league/html-to-markdown/LICENSE Ver arquivo


vendor/league/html-to-markdown/README.md → src/vendor/league/html-to-markdown/README.md Ver arquivo


vendor/league/html-to-markdown/bin/html-to-markdown → src/vendor/league/html-to-markdown/bin/html-to-markdown Ver arquivo


vendor/league/html-to-markdown/composer.json → src/vendor/league/html-to-markdown/composer.json Ver arquivo


vendor/league/html-to-markdown/src/Configuration.php → src/vendor/league/html-to-markdown/src/Configuration.php Ver arquivo


vendor/league/html-to-markdown/src/ConfigurationAwareInterface.php → src/vendor/league/html-to-markdown/src/ConfigurationAwareInterface.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php → src/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/CommentConverter.php → src/vendor/league/html-to-markdown/src/Converter/CommentConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/ConverterInterface.php → src/vendor/league/html-to-markdown/src/Converter/ConverterInterface.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/DefaultConverter.php → src/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/DivConverter.php → src/vendor/league/html-to-markdown/src/Converter/DivConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/EmphasisConverter.php → src/vendor/league/html-to-markdown/src/Converter/EmphasisConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php → src/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/HeaderConverter.php → src/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/HorizontalRuleConverter.php → src/vendor/league/html-to-markdown/src/Converter/HorizontalRuleConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/ImageConverter.php → src/vendor/league/html-to-markdown/src/Converter/ImageConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/LinkConverter.php → src/vendor/league/html-to-markdown/src/Converter/LinkConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/ListBlockConverter.php → src/vendor/league/html-to-markdown/src/Converter/ListBlockConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/ListItemConverter.php → src/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php → src/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php → src/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Converter/TextConverter.php → src/vendor/league/html-to-markdown/src/Converter/TextConverter.php Ver arquivo


vendor/league/html-to-markdown/src/Element.php → src/vendor/league/html-to-markdown/src/Element.php Ver arquivo


vendor/league/html-to-markdown/src/ElementInterface.php → src/vendor/league/html-to-markdown/src/ElementInterface.php Ver arquivo


vendor/league/html-to-markdown/src/Environment.php → src/vendor/league/html-to-markdown/src/Environment.php Ver arquivo


vendor/league/html-to-markdown/src/HtmlConverter.php → src/vendor/league/html-to-markdown/src/HtmlConverter.php Ver arquivo


+ 0
- 1
vendor/bin/html-to-markdown Ver arquivo

@@ -1 +0,0 @@
../league/html-to-markdown/bin/html-to-markdown

Carregando…
Cancelar
Salvar