Giter Club home page Giter Club logo

early-galaxy's Introduction

Early Galaxy

Simple command-line tool for posting to Blogger. This script was written to enable posting to a blogger.com blog from the command line automatically. It is really a part of an earlier project which stopped working due to Google pulled the support for OAuth 1.0 and the GoogleCL tool stopped working. To my suprise, no one has rewritten that tool as of March 2016 and therefore the need for this specific script.

Requirements

You will need to install the google-api using pip:

$ pip install --upgrade google-api-python-client

Blogger API v3

The Blogger API v3 allows client applications to view and update Blogger content. Your client application can use Blogger API v3 to create new blog posts, edit or delete existing posts, and query for posts that match particular criteria.

To use this script with the Blogger API v3, you need to a generate OAuth 2.0 client ID. Refer to the API documentation for details.

Get started

Follow these steps to get up and running with the script. The project used in the example is not active and therefore the keys are not working.

  1. Go to: https://console.developers.google.com/apis/credentials?project=_

  2. Create a new project

  3. Enable Blogger API

  4. Create credentials (OAuth client ID)

  5. Download JSON and save as client_secrets.json in the same folder as the script

    If you want, you can format the JSON code using: www.jsoneditoronline.org

  6. You also need to change the blogID at the beginning of the script to match the blog you want to post to. This ID is visible when you are logged into Blogger.com with your Google account.

    myblogid = 8032756911295504398

Usage

To use the script, you need to run the script with a couple of arguments:

--title "Your blog post title"
--src <file containing your blogpost written in html>

an optional argument can be used

--label "labels, separated, by, comma" 

Example

Post to blogger

$ python blogger.py --title "Five nice haiku poems" --labels "haiku" --src haiku.html 

Get your blogIDs (not yet implemented)

$ python blogger.py --blogs

Enjoy posting from the command line!

early-galaxy's People

Stargazers

 avatar

Watchers

 avatar  avatar

early-galaxy's Issues

Deleting posts from blog

Great tool, works flawlessly. Any chance for implementing post removing from blog? Post editing / updating would be also a valuable feature.

Labels aren't posted to the blog

Hi!
Using your script I realized, that labels (or tags) aren't posted with option --labels , -l
But I found out that only a minor change in the code is needed:

# Assign argument values to variables
    flags = parent.parse_args(argv[1:])
    blogtitle = flags.title
    blogtags = flags.labels.split(",")
    blogfilename = flags.src
    blog_id = flags.blogid

labels need to be splitted into a list with .split(",")

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.