Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vti/publishr
Publish updates to several social networks simultaneously
https://github.com/vti/publishr
Last synced: 5 days ago
JSON representation
Publish updates to several social networks simultaneously
- Host: GitHub
- URL: https://github.com/vti/publishr
- Owner: vti
- Created: 2014-11-28T18:07:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-12T19:34:13.000Z (over 9 years ago)
- Last Synced: 2024-08-02T12:44:26.364Z (3 months ago)
- Language: Perl
- Size: 248 KB
- Stars: 16
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - vti/publishr - Publish updates to several social networks simultaneously (others)
README
# Publishr
Allows updating status on several social networks, sending email etc.
Supported actions:
1. Facebook
1. wall (text, link)
1. Livejournal
1. journal (text, link, image, tags)
1. community (text, link, image, tags)
1. Twitter (status + link, image)
1. VK
1. page wall (text, link, image)
1. group wall (text, link, image)
1. from user
1. from group
1. Email
1. SMTP
1. Jabber/XMPP
1. blog (text, link, tags)
1. IRC
1. channel
1. Skype (via Skype4Py)
1. chat room## Installation
Download [cpanm](http://search.cpan.org/perldoc?cpanm):
curl -LO http://xrl.us/cpanm
Install modules using [cpanfile](http://search.cpan.org/perldoc?cpanfile)
in current directory by --installdeps option of [cpanm](http://search.cpan.org/perldoc?cpanm):perl cpanm --installdeps .
## Preparing message
Mesage is a text file:
```
Status: New article is out
Link: http://mywebsite.com
Image: /path/to/image
Tags: perlJust a long text
with
multilines...
```Depending on the channel various information is used. For example for twitter
the status, link and image are used and for facebook everything combined. And so
on.## Configuring access
Access is configured via a JSON file:
```
# Comments are supported{
# First we define access for different channels (types). After giving them names
# we can reference them in scenarios
"access" : [
{
"name" : "twitter",
"options" : {
"access_token" : "",
"access_token_secret" : "",
"consumer_key" : "",
"consumer_secret" : ""
},
"type" : "twitter"
},
{
"name" : "facebook",
"options" : {
"access_token" : "",
"app_id" : "",
"secret" : ""
},
"type" : "facebook"
},
{
"name" : "vk",
"options" : {
"access_token" : ""
},
"type" : "vk"
},
{
"name" : "livejournal",
"options" : {
"password" : "",
"username" : ""
},
"type" : "livejournal"
},
{
"name" : "juick",
"options" : {
"password" : "",
"jid" : ""
},
"type" : "juick"
},
{
"name":"gmail",
"type":"email",
"options": {
"transport": {
"host" : "smtp.gmail.com",
"port" : 587,
"username" : "[email protected]",
"password" : ""
}
}
},],
# Example scenarios
"scenarios" : [
{
"access" : "twitter",
"name" : "twitter"
},
{
"access" : "juick",
"name" : "juick"
},
{
"access" : "livejournal",
"name" : "livejournal"
},
{
"access" : "livejournal",
"name" : "livejournal community",
"options" : {
"usejournal" : ""
}
},
{
"name" : "vk wall",
"access" : "vk",
"options" : {
"user_id" : ""
}
},
{
"name" : "vk group",
"access" : "vk",
"options" : {
"group_id" : ""
}
},
{
"name" : "facebook group",
"access" : "facebook",
"options" : {
"group_id" : ""
}
},
{
"name":"newsletter",
"access":"gmail",
"options": {
"headers":[
"From", "[email protected]",
"To", "..@..."
]
}
},
{
"name":"irc channel",
"options":{
"hostname":"irc.perl.org",
"channel":"#ru.pm"
}
},
{
"name":"skype",
"options":{
"env":{
"PYTHONPATH":"/path/to/skype4py/"
},
"cmd":"./util/skype-chat.py 'Chat room' '%status% %link%'"
}
}
]
}
```## Publishing
By default the config file is name `publishr.json` and is searched within
a current working directory. To overwrite path to config file use `--config`
option.```
perl script/publishr message.txt
perl script/publishr --config another-config.json message.txt
```### Dry run
You can check what's going to happen using `--dry-run` option:
```
perl script/publishr --dry-run message.txt
```### Publishing only specific scenario
If you want to publish only to a specific scenario, just use `--scenario`
option:```
perl script/publishr --scenario 'vk wall' message.txt
```### Publishing only to specific channel
If you want to publish only to a specific social network, just use `--channel`
option:```
perl script/publishr --channel twitter message.txt
```## Getting access tokens
Has to be done once.
1. Register your application via .
2. Get your consumer and access tokens from
.
Here you may have to confirm your phone number, only then Twitter will allow
you to update statuses within an application.
3. Save `consumer_key`, `consumer_secret`, `access_token`,
`access_token_secret`.Has to be done every two months.
1. Create your application via .
2. Visit API Explorer .
3. Generate Access Token previously selecting your app.
4. Create a long-term token visiting
5. Save `app_id`, `secret`, `access_token` and `group_id`.## VK
Has to be done once.
1. Create your application via .
2. Get a token visiting
3. Discover your user id.
3. Save `acess_token` and `user_id`.## Livejournal
Just use your `username` and `password`.
## Juick
Link you preffered Jabber ID to your [Juick](https://juick.com) account.
1. Send an IM to [email protected].
2. Follow the link.
3. Save `jid` and its `password`.