Giter Club home page Giter Club logo

import-from-wallabag's Introduction

Import From Wallabag

Automatically import wallabag entries into WordPress. For those not in the know, wallabag is a free, self-hosted read-it-later app.

Configuration

First, create a wallabag API client. Then head over to WP Admin's Settings > Import From Wallabag and fill out your client ID and secret, and your wallabag username and password, too.

Alternatively, add your username and password to your WordPress install's config.php:

define( 'IMPORT_FROM_WALLABAG_USER', '<your-wallabag-username>' );
define( 'IMPORT_FROM_WALLABAG_PASS', '<your-wallabag-password>' );

Other options include: target Post Status, Post Type and Post Format, and an optional Tags setting. (Only items that match all of these tags will be imported.)

Usage

Import From Wallabag will automatically run twice a day and import the most recent 30 entries that match the provided tags and were added after it was run last.

Filter Hooks

Use import_from_wallabag_api_args to filter the API arguments:

add_filter( 'import_from_wallabag_api_args', function( $args ) {
  $args['perPage'] = 60;   // When 30 is not enough.
  unset( $args['since'] ); // Grab all last 60 items, regardless of when they were created.
  return $args;
}, 10, 2 );

The formatting of imported posts can be completely customized using import_from_wallabag_post_args:

add_filter( 'import_from_wallabag_post_args', function( $args, $entry ) {
  // Modify, e.g., `$args['post_content']`.
  return $args;
}, 10, 2 );

import-from-wallabag's People

Contributors

janboddez avatar

Stargazers

Aris avatar consultor.ml avatar  avatar

Watchers

James Cloos avatar  avatar

import-from-wallabag's Issues

Use "since" API param

Right now the most recent 30 entries (or so) are fetched and duplicates dismissed (if the chosen post type supports custom fields, that is). We can optimize by adding the optional since param (and save [or guess] when the import was last run).

Use a custom table to track processed items

Drop the slow meta query (that isn't guaranteed to work for all post types) and track imported items in a custom table instead. That way, deleted (not merely trashed) items won't be re-imported, either.

Handle empty endpoints/feeds

Think I saw this error or notice or something after I deleted my wallabag instance and forgot to disable the plugin. We might want to handle this sort of thing a bit better.

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.