OpenCollective plugin

(Sudaraka Jayathilaka) #1

Hi all,
I would really love to participate in GSoC 2017 for Discourse. I believe that the plugin for integrating OpenCollective is a very crucial project for this community. I have been in this community from last year and i have a fair understanding about the discourse code base .I am currently researching about Open Collective’s api and the platform. I like to discuss more on this topic on this conversation. :slight_smile: I’m really excited about this project.I already started chatting about the api usage in open collective’s slack.

Project ideas for Google Summer of Code 2017
(Sudaraka Jayathilaka) #2

Hi all,
For past few days, i made few sample plugins and studied “Open Collective” API. I had a chat with their team and, they were very happy to extend their API as per out request. But first I need to clarify few things about the plugin.
I think there are two possibilities to retrieve data,

  • Storing sites’ backers and sponsors in a Discourse database and updating the data within some time interval

  • Constantly retrieving data from their API endpoints real time.

But the issue is will it slow down the overall performance. At the moment we can only retrieve only the complete list of backers and sponsors for a certain organization. @erlend_sh @sam can you please present your views on this matter. Thank you :slight_smile: . It’s always so cool to work here.

(Rafael dos Santos Silva) #4

You should always cache data like that locally.

We have the class PluginStore, a Key-Value that will help you on that.

Use a Sidekiq job, that will be triggered each N hours, and will sync all the necessary data.


EDIT: I took a look at Open Collective API last week, and it has pretty much all we need, except that only usernames (and optional website) identify users, and we would need emails.

(Sudaraka Jayathilaka) #5

hi @Falco,
This is exactly what i was looking for. I will use a Sidekiq job. Yeah the other problem that occured to me was mapping open collective accounts with discourse accounts. I will ask from their team whether they can provide emails of their users through the API. Thank you a lot :slight_smile:

(Sudaraka Jayathilaka) #6

Is there any plugins made for discourse that uses sidekiq jobs?

(Rafael dos Santos Silva) #7

The same plugin I used as an example above uses jobs: GitHub - discourse/discourse-slack-official: Official Slack integration for Discourse

PushNotifications too: discourse-push-notifications/plugin.rb at master · discourse/discourse-push-notifications · GitHub

Translator: discourse-translator/plugin.rb at master · discourse/discourse-translator · GitHub

(Sudaraka Jayathilaka) #8

Thank you @Falco :slight_smile:

(Sudaraka Jayathilaka) #10

I finished the basic implementations of the OpenCollective Plugin for Discourse. Now it caches the list of sponsors for a particular collective every two seconds (I used 2 seconds for testing purpose) through a sidekiq job and it shows the list of sponsors in the admin interface /admin/plugins/opencollective .

Can you please take a look at the repo. It’s available on :

(Sudaraka Jayathilaka) #11

I wrote the plugin in a hurry and few styles has to be added. I created it for demonstration purpose. :slight_smile:

(Sudaraka Jayathilaka) #12

Open Collective Team is willing to provide access to the user emails through their API :slight_smile:

(Sudaraka Jayathilaka) #13

I submitted my project proposal for Google Summer of Code 2017. Thank you for all the support you gave me. I learned a lot . If I get selected , I will do my best to make it a success :slight_smile:

(Sudaraka Jayathilaka) #14

Hi all,
I was able to get a test collective and an a token for my testing purposes from open collective. :slight_smile:

(xiasummer) #15

Very Great and very important job.

(Sudaraka Jayathilaka) #16

Thank you @xiasummer :slight_smile: The plugin will be available soon.

(Sudaraka Jayathilaka) #17

Hi all,
I just finished the plugin with granting functionality .

The users are mapped based on their emails. Currently I have defined just a single badge. my repo can be found on