Coder Social home page Coder Social logo

tumblr4r_backup's Introduction

About

Backup script for tumblr using tumblr4r.

Adds a Backup subclass of Tumblr4r's Site class that makes backups of posts as well as images (for photo and regular posts)

Outputs to Jekyll-inspired plain text files with YAML metadata in the front matter. To substitute a different backup method, you'd have to change write_file as well as get_existing

Dependencies: tumblr4r, sanitize.

Usage

Use like this:

 site = Tumblr4r::Backup.new('blogname.tumblr.com')
 site.backup_path = "/path/to/your/backups"
 site.make_backup

tumblr4r_backup's People

Contributors

bong0 avatar justinxreese avatar smajda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tumblr4r_backup's Issues

Logging level too high - messages not dispatched

I get logging on a debugging level always though this is very bad for running the script in production (for me in a cronjob).
The output looks like this:

/api/read?num=1
<?xml version="1.0" encoding="UTF-8"?>
<tumblr version="1.0"><tumblelog name="user" [...]

The fix I tried failed (pretty naive approach, but I have zero knowledge of ruby)

site = Tumblr4r::Backup.new('user.tumblr.com')
site.backup_path = "/mnt/backups/tumblr"
site.default_log_level = Logger::INFO
site.make_backup

Inserting the log-level setting here:

  class Backup < Site
    attr_accessor :backup_path
   @@default_log_level = Logger::INFO

helps, but still does not output the information I expect this lines to do:

            # log the backup
            @logger.info("Backed up \"#{bp[:title]}\"")

I'm running ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux].

Errors with both 1.9.2 and 1.8.7

I'm trying out your script, but get runtime errors using both ruby 1.9.2 and 1.8.7 (system)

1.9.2

Phyx:tumblr4r_backup $ rvm default
Phyx:tumblr4r_backup $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
Phyx:tumblr4r_backup $ ruby tumblr4r_backup.rb 
tumblr4r_backup.rb:214: syntax error, unexpected ':', expecting keyword_do_cond or ';' or '\n'
tumblr4r_backup.rb:220: syntax error, unexpected keyword_do_cond, expecting keyword_end
        posts.each do |p|
                     ^
tumblr4r_backup.rb:249: syntax error, unexpected keyword_end, expecting $end

1.8.7

Phyx:tumblr4r_backup $ rvm system
Phyx:tumblr4r_backup $ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Phyx:tumblr4r_backup $ ruby tumblr4r_backup.rb 
/Library/Ruby/Gems/1.8/gems/tumblr4r-0.7.2/lib/tumblr4r.rb:34: undefined method `cattr_accessor' for Tumblr4r::Site:Class (NoMethodError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    from tumblr4r_backup.rb:3
Phyx:tumblr4r_backup $ 

I'm pretty new at ruby, but I'll try to work it out. Just wanted to report this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.