Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Georepublic/localwiki_email_uploader

Repository files navigation

Localwiki Email Uploader

Localwiki content uploader from email using Localwiki API and custom API(see About Custom API). Email sender's address required in relation to User and API Key. Email subject is used Localwiki's page name. If Localwiki's page doesn't exist, create page and map, and upload jpeg file. If Localwiki's page exist, upload jpeg file, and modify page(don't modify map).

About Custom API

Custom API is available at Our branch. This API allow access to get API key. Please check commit for api.

Setup

This is ruby script, install ruby 1.9.3 and follow:

$ gem install bundler
$ bundle install --path vendor/bundle
$ cp api_settings.rb.example api_settings.rb
$ vim api_settings.rb
(edit your setting)

And setup your .forward file. For example, if you use rbenv:

$ cp sample/rbenv-entrypoint.sh app.sh
$ chmod +x app.sh
$ vim ~/.forward
| <your path>/localwiki_email_uploader/app.sh

Please check rbenv-entrypoint.sh, this file has many hints.

If you setup in Ubuntu, see also: Setup Email Uploader in Ubuntu

app_settings.rb

ex: Localwiki's instance run "http://example.com" and create user "mail" and generate api_key "xxx" and add tag "frommail".

def get_setting
  return {
    :base_url => 'http://example.com',
    :user_name => 'mailuser',
    :api_key => 'xxx',
    :tag_slug => 'frommail'
  }
end

Test

Save email and follow:

$ cat test.eml | bundle exec ruby parser.rb

Note

This script designed for our customer. Please hack as you please.

License

Released under the MIT license.

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages