Giter Club home page Giter Club logo

rssharp's Introduction

RSSharp

A .NET library giving access to various RSS feed aggregation services

General

All access is done using the methods in the class ApiCalls (for example in the namepace RSSharp.Feedly.ApiCalls for Feedly) and all the data structures can be found in the Model class (for example in the namepace RSSharp.Feedly.Model for Feedly)

So it might be a good idea to start you files with something like

using RSSharp.Feedly.Model;

using RSSharp.Feedly.ApiCalls;

Newtonsoft's JSON library is needed and used.

Authentication

There is a class called "Authentications" in the ApiCalls namespace which provides quite some help on the auth stuff. For Feedly those are:

get_authentication_url(string response_type = "code", string client_id = "", string redirect_uri = "", string scope ="https://cloud.feedly.com/subscriptions", string state = "")

which provides the url you need to open in a WebBrowser for the user to enable access to Feedly

Authentication.auth_response parse_authentication_reponse(string url)

A response URL parser which looks for success / error in the url

And two methods to get the access token (either directly or using a refresh token.

As this stuff with OAuth might be quite confusing when bulding a desktop app (it's much easier within a web app) I also added a fully automated process which opens an extra window and does all the stuff automatically. This is true for a Windows Desktop app but not a a Modern UI one I have to say.

Here is how it works by the example in Menere:

	public void add_new_account()
    {
        //RSSharp.Feedly.Configuration.activate_sandbox();
        RSSharp.Feedly.ApiCalls.Authentication_window auth_window = new RSSharp.Feedly.ApiCalls.Authentication_window("*********", "**********", "http://yourRedirectUri");
        auth_window.AuthSuccess += auth_window_AuthSuccess;
        auth_window.Show();
        auth_window.startAuthorization();
    }

    void auth_window_AuthSuccess(object sender, RSSharp.Feedly.ApiCalls.Authentication_window.AuthEventArgs e)
    {
        if (e.success)
        {
            token = e.token;
        	// check token, save it, go on, ...
        }
        else
        {
            System.Windows.MessageBox.Show(e.error, "Error adding Feedly account");
        }
    }

As you see you'll open a window and subscribe to the event "AuthSuccess" there. In this event you get either the token or an error message as response.

Getting data

Every Api endpoint has a method in the ApiCalls namespace - some examples:

Getting the user profile

Profile user_profile = Profiles.get(YourAccessToken);

Getting the subscribed feeds

List<Subscription> subscriptions = Subscriptions.get(YourAccessToken);

Getting entries in a stream (in this example the saved items)

Streams.entries_list saved_entries = Streams.get_entries_in_stream(YourAccessToken, string.Format("user/{0}/tag/global.saved", this.profile.id), count: 1000);

Changing items

Marking as read

RSSharp.Feedly.ApiCalls.Markers.mark_entry_as_read(YourAccessToken, item_id);

Help

Feel free to contact me ([email protected]) if you have any questions

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.