项目作者: TheFox

项目描述 :
Import posts to Tumblr from a text file.
高级语言: PHP
项目地址: git://github.com/TheFox/tumblr-importer.git
创建时间: 2013-08-12T08:40:03Z
项目社区:https://github.com/TheFox/tumblr-importer

开源协议:

下载


Tumblr Importer

Import posts from a text file. One line per post.

Install

  1. Register application on Tumblr.
  2. Click on Explore API and grant your application to access your Tumblr account to get the Token and the Token Secret.
  3. Create parameters.yml file with your keys and tokens vom step 2.

    Template (see parameters-tpl.yml):

    1. tumblr:
    2. consumer_key:
    3. consumer_secret:
    4. token:
    5. token_secret:
    6. blog:

    Example:

    1. tumblr:
    2. consumer_key: ylThIsIsOnlyAFaketADKThIsIsOnlyAFake1j3NlCBjPY3SI
    3. consumer_secret: 5qThIsIsOnlyAFakeHHoMgThIsIsOnlyAFakeW
    4. token: mThIsIsOnlyAFakeqmRdTYFDThIsIsOnlyAFakeck
    5. token_secret: vDlMllCvThIsIsOnlyAFake2rrEThIsIsOnlyAFakeeYijk
    6. blog: thefox21

    blog is the name of your blog the posts will be created.

  4. Install Composer Packages.

    Run the following command in your shell:

    1. composer update
  5. Create a posts.txt file.

  6. Run php import.php in your shell.

posts.txt

Create a posts.txt file in the same directory as import.php. There are (up to now) only queued quote posts possible.

Format

  1. Text
  2. Text # Tag1
  3. Text # Tag1,Tag2
  4. Text - Source
  5. Text - Source # Tag1,Tag2
  6. This is my Hello World example. # HelloWorld,Hello World
  7. This is my Hello World #example. # HelloWorld

Each line is one post.

—no-clear

You can pass --no-clear through the arguments of import.php to leave posts.txt with the original content:

  1. php import.php --no-clear

Otherwise posts.txt will be cleared after import.php is executed.

Tumblr API v2 documentation

http://www.tumblr.com/docs/en/api/v2

License

Copyright (C) 2013 Christian Mayer http://fox21.at

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses.