Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pic-postr
Advanced tools
Readme
Pictures uploader tool, supports tumblr, flickr and Yandex.Fotki (more services support to come). Uploads given pictures from configured folders and watches for new files being added to upload.
npm install pic-postr
Each service requieres OAuth authentication to perform picures upload. This implies API keys retrieving process completion for pic-postr app with each service you desire to post to.
To accomplish this process, refer to servie's docs:
Example folders structure
/base/folder/
tumblr-drafts
tumblr-queue
flickr-public
Folders tumblr-drafts
, tumblr-queue
and flickr-public
could contain some pictures at the run moment or files
could be added on the fly.
Runner script (postr.js
):
require('pic-postr').init('/base/folder', {
logLevel: 'info',
tumblr: {
appConsumerKey: '...',
appSecretKey: '...',
accessToken: '...',
accessSecret: '...',
interval: 30,
blog: 'the-blog',
post: {
caption: 'Feel free to LIKE my photo',
date: function (filePath) {
return new Date(require('fs').statSync(filePath).ctime).toISOString()
}
}
},
flickr: {
appConsumerKey: '...',
appSecretKey: '...',
accessToken: '...',
accessSecret: '...',
interval: 10,
order: 'abc',
extractIptc: true,
post: {
title: function (filePath, metaIptc) {
return metaIptc.description;
},
// more about metaIptc: https://github.com/achesco/extract-iptc
tags: function (filePath, metaIptc) {
!metaIptc.keywords && return null;
return typeof meta.keywords === 'string' ? meta.keywords : meta.keywords.join(' '); // flickr requires white-space separated tags
},
is_public: 1
}
},
fotki: {
userName: 'yandex-login',
accessToken: '...',
album: 'My Album Name'
},
folders: {
'tumblr-drafts': {
service: 'tumblr',
interval: 20,
order: 'abc',
post: {
state: 'draft'
}
},
'tumblr-queue': {
service: 'tumblr',
order: 'random',
post: {
state: 'queue'
}
},
'flickr-public': {
service: 'flickr'
},
'to-fotki': {
post: {
access: 'private',
xxx: true
}
}
}
});
After node postr.js
execution we'll get main program running, posting and monitoring configured folders with given
settings by child processes. Could be run as a background service.
node postr.js > postr.log 2>&1 &
require('pic-postr').init(baseFolderPath, appConfigOptins);
String containing absolute or relative path to the base application folder. Base folder must contain images folders
configured under the folder
section of appConfigOptions
.
Application config object, possible fields are:
Option | Type | Default | Description |
---|---|---|---|
logLevel | String | 'warn' | Optional. Possible values are: 'debug' , 'info' , 'warn' , 'error' |
imConvertPath | String | 'convert' | Optional. Path to imagemagick's convert utility, if not in PATH |
tumblr | tumblrConfigOptions | - | Config for Tumblr. Used for folders with service: 'tumblr' |
flickr | flickrConfigOptions | - | Config for Flickr. Used for folders with service: 'flickr' |
fotki | fotkiConfigOptions | - | Config for Yandex.Photos. Used for folders with service: 'fotki' |
folders | Object | - | Object with keys matching picture folders inside baseFolderPath directory, values are: folderConfigOptions |
Option | Type | Default | Description |
---|---|---|---|
appConsumerKey | String | - | Service API application consumer key for OAuth |
appSecretKey | String | - | Service API application secret key for OAuth |
accessToken | String | - | Service API OAuth access token |
accessSecret | String | - | Service API OAuth access secret |
interval | Number | 60 | Time interval between posts for service, in seconds |
order | String | 'abc' | Optional. Post files in given order (file name is used for sorting). Values: 'abc' , 'zyx' , 'random' |
extractIptc | Boolean | false | Optional. Extract IPTC/XMP metadata to be used in post fields callbacks. |
post | postConfigOptions | N | Data object fields to post config |
Option | Type | Default | Description |
---|---|---|---|
blog | String | N | Blog name to post to. Can be overriden with folderConfigOptions.blog |
Option | Type | Default | Description |
---|---|---|---|
userName | String | - | Yandex login (without @yandex) |
accessToken | String | - | Service API OAuth access token |
interval | Number | 60 | Time interval between posts for service, in seconds |
order | String | 'abc' | Optional. Post files in given order (file name is used for sorting). Values: 'abc' , 'zyx' , 'random' |
extractIptc | Boolean | false | Optional. Extract IPTC/XMP metadata to be used in post fields callbacks. |
album | String | N | Album name to post to. Can be overriden with folderConfigOptions.album |
post | postConfigOptions | N | Data object fields to post config |
Option | Type | Default | Description |
---|---|---|---|
service | String | N | 'tumblr' , 'flickr' or 'fotki' |
Plus any of the following service-level config fields: interval , order , extractIptc , post ; | |||
blog for tumblr-only and album for fotki may also be overriden on folder level. |
Post config options depend on service. Any supported field's config value could be set to function. It'll be called for every time before posting picture file and should return fiel's value. Function arguments are:
filePath
path to file being postedmetaIptc
metadata parsed from image being posted. Requires extractIptc
optinon set to true
.Return value should be service's API compatible value. Return null
or undefined
to ignore and use default instead.
Supported fields are: state
, tags
, tweet
, date
, format
, slug
, caption
, link
, source
.
Description and possible values
Supported fields are: title
, description
, tags
, is_public
, is_friend
, is_family
, safety_level
, content_type
, hidden
.
Description and possible values
Supported fields are: title
, summary
, hide_original
, xxx
, disable_comments
, access
, tags
.
Description and possible values
If metaIptc
set to true
post fields options set to function
will receive extracted IPTC metadata object
as second param (file path is first). Metadata fields details
FAQs
Pictures uploader tool for tumblr, flickr, yandex.fotki
The npm package pic-postr receives a total of 1 weekly downloads. As such, pic-postr popularity was classified as not popular.
We found that pic-postr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.