0.01
No release in over 3 years
Low commit activity in last 3 years
A ruby gem for Uploading image to Hatena Fotolife
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
>= 0
~> 13.0
~> 3.0
>= 0

Runtime

 Project Readme

HatenaFotolife

A library to Hatena Fotolife Atom API. You can upload image to hatena fotolife using this gem. This gem is inspired_by hatenablog gem

Installation

Add this line to your application's Gemfile:

gem 'hatena_fotolife'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hatena_fotolife

OAuth credentials

Hatena Fotolife API requires user authentication with OAuth. So you need to get OAuth 1.0a keys and consumer tokens before using this gem.

1. Get consumer_key & consumer_secret

Get consumer_key and consumer_secret from Hatena Developer Center

2. Get access_token & access_token_secret

% bundle exec get_access_token <consumer_key> <consumer_secret>

Usage

  1. Create config.yml file
consumer_key: <Hatena application consumer key>
consumer_secret: <Hatena application consumer secret>
access_token: <Hatena application access token>
access_token_secret: <Hatena application access token secret>
consumer_options:
  timeout: 300
  open_timeout: 60
  1. Run
require 'hatena_fotolife'

# Read the configuration from 'config.yml'
HatenaFotolife::Client.create.post_image(file_path: your_image_path)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rlho/hatena_fotolife. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the HatenaFotolife project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.