GithubHelp home page GithubHelp logo

fragag / feeds-to-pocket Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 5.0 145 KB

Sends entries from RSS and Atom feeds to Pocket (https://getpocket.com)

License: Apache License 2.0

Rust 96.74% Nix 3.26%
pocket feed atom rss

feeds-to-pocket's People

Contributors

fragag avatar quinnypig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

feeds-to-pocket's Issues

Entries not pushed to Pocket

Since a couple of days ago, the entries synced by the app are not pushed to my Pocket account.
Here are some steps I tried in order to see if the issue was temporary:

  • I have tested both versions v0.1.6 and v.0.1.7 (the latter compiled manually as it wasn't uploaded to crates.io) both locally and from a remote instance (where the app has always worked flawlessly)
  • I also tried to force update the app and its dependencies (everything was fine in the process)
  • I called the API endpoint manually https://getpocket.com/v3/add with few test entries passing consumer_key, access_token as per my YAML file. In all cases I got a 200 response and the entries got uploaded successfully to my Pocket. This seems to exclude any authentication or authorization issue from my end.

The app seems to work as I can see the logs 'downloading feeds' and 'pushing feeds to Pocket', but they don't get uploaded to my Pocket as they always did.

If anybody is experiencing the same issue or can help, please let me know!

Could not compile `bitflags`

Hi,

Was looking to check this project out. I get a build error when trying to install with cargo. Any Idea how to resolve this issue?

macOS version 10.11.6

 $ cargo --version 
    cargo 0.20.0 (a60d185c8 2017-07-13)
$ cargo install feeds-to-pocket
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing feeds-to-pocket v0.1.5
   Compiling lazy_static v0.2.11
   Compiling safemem v0.2.0
   Compiling httparse v1.2.4
   Compiling version_check v0.1.3
   Compiling unicode-width v0.1.4
   Compiling matches v0.1.6
   Compiling strsim v0.6.0
   Compiling rustc-demangle v0.1.5
   Compiling byteorder v1.2.1
   Compiling slab v0.4.0
   Compiling bitflags v1.0.1
   Compiling serde v1.0.27
error: expected ident, found #
   --> /Users/Joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/lib.rs:423:29
    |
423 |                               #[allow(deprecated)]
    |                               ^
    |
   ::: /Users/Joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/example_generated.rs
    |
4   | / bitflags! {
5   | |     /// This is the same `Flags` struct defined in the [crate level example](../index.html#example).
6   | |     /// Note that this struct is just for documentation purposes only, it must not be used outside
7   | |     /// this crate.
...   |
13  | |     }
14  | | }
    | |_- in this macro invocation

error: Could not compile `bitflags`.
Build failed, waiting for other jobs to finish...
error: failed to compile `feeds-to-pocket v0.1.5`, intermediate artifacts can be found at `/var/folders/dr/x3dscnqj3zj8kpyydf2cszhw0000gn/T/cargo-install.3TkOv4rYfJhF`

Caused by:
  build failed

Can't login to pocket

I get the error "The link you followed here is no longer working" on pocket after running feeds-to-pocket ~/feeds-to-pocket.yaml login

Handle relative URLs in entries

Feeds to Pocket currently doesn't support relative URLs in entries. When a relative URL is encountered, it is added to the feed's processed_entries, but it is not sent to Pocket.

We use Url::parse, which only handles absolute URLs. Url::join can resolve an URL relative to a given absolute URL.

There are feeds in the wild that have relative URLs in their entries. The one that affects me right now is Sonic Retro's Atom feed: it uses scheme-relative URLs (i.e. URLs that begin with //sonicretro.org). (It has been doing so since sometime in March 2018, but I only notice it now, 8 months later. Oops!)

Atom specifies that the href attribute of a link element must be an IRI reference. An IRI reference can be an absolute or a relative IRI. The RSS "specification" mentions in the first paragraph under Comments that links must begin with a scheme, meaning they must be absolute URLs.

Relative URLs are supposed to be resolved by taking the xml:base attribute into account. This attribute can be applied on any XML element. Both rss and atom_syndication expose an extensions method that contain namespaced elements, but namespaced attributes seem to be ignored, and xml:base is not preserved specifically either. xml:base attributes can also contain relative URLs, and parsing the values in xml:base attributes can fail. Ideally, we would ignore errors in xml:base attributes when resolving an URL that is already absolute.

One thing to consider is whether we should use the original URL (possibly relative) or the fully-resolved absolute URL in processed_entries. Using the absolute URL means that if a feed switches from absolute URLs to relative URLs, then the URLs won't be sent again to Pocket. Pocket expects absolute URLs anyway, so we would be storing the URL we sent, essentially.

Question: Storing all previous posts in of a feed in the config.

I would be interested in hearing your reasoning for this decision, not that I think it is wrong, but I made my own decision when making this in Go.

When adding a feed $ feeds-to-pocket ~/feeds-to-pocket.yaml add https://xkcd.com/atom.xml this program can fetch all the previous blog posts and store them in the yaml file. When building this in Go, I found that when reading the URL for new posts I only needed to store the latest blog post each time. This means that the yaml file doesn't get bigger and bigger the longer this program is used.

I am not really familiar with Rust code (looking to learn) so I can't comment on the technical side of things but would it be possible to use a similar approach here?

To clarify :

  1. Request posts from RSS feed
  2. Starting from the latest post from this request, check if it matches the url saved in the yaml file
  3. If it does match, stop. We have the latest post (go to 5 else go to 4)
  4. If it does not match move on the the next url in the feed. (Go to 3)
  5. Update the yaml with the latest post from the feed

I don't know if that clarifies or not. Would love to hear your take on this decision and what led you to adopt the approach you did.

Thanks again!

Feature idea: Delete / Remove a feed

I have been using this for a little while now and I think you have done a great job ๐Ÿ‘ Thanks for building the thing I need.

There have been a few times that I have needed to remove a feed from my list. Either a broken link or I am no longer interested in that blog.

Would it be a good idea to include an additional command to remove a feed ?

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.