codeforamerica / project-ideas

A place to collect ideas for CfA health projects
41 stars 10 forks source link

Make a Civic Issue Twitter Bot #42

Closed ondrae closed 8 years ago

ondrae commented 10 years ago

Post a random "help wanted" civic tech issue to Twitter thrice a day.

A general bot would use this url http://codeforamerica.org/api/issues/labels/help wanted?per_page=1

Make it specific for your Brigade http://codeforamerica.org/api/issues/labels/help wanted?organization_name=Code for San Francisco&per_page=1

Make one for Code for All or Brigade wide http://codeforamerica.org/api/issues/labels/help wanted?organization_type=Code for All&per_page=1

Cross posted at https://github.com/codeforamerica/civic-issue-finder/issues/16

ondrae commented 10 years ago

Do a Reddit bot too

urbildpunkt commented 9 years ago

It might take some creative (read: complicated) recipe designs but you could probably achieve this using IFTTT.

Mr0grog commented 9 years ago

Honestly, I think this would be easy enough to do via Heroku or maybe AWS lambda (haven’t tried that yet). Not sure it’s worth even bothering to try and be creative with IFTTT, unless you see an obvious way to do it (I don’t, but I’m no expert there).

Also, is http://codeforamerica.org/api/issues/labels/help wanted?per_page=1 actually random? That’s convenient for this use case, but that seems kind of crazy; how do you reliably use the paging features if that’s the case?

ondrae commented 9 years ago

If we had an RSS output for everything, then IFTTT would be super easy.

Mr0grog commented 9 years ago

Well, you want a nice, steady once per day tweet, not every time (and only when) there's a new issue, right? So just having RSS won't get you there. Otherwise you could just transform the API into RSS with Yahoo Pipes. On Jan 6, 2015 1:16 PM, "Andrew Hyder" notifications@github.com wrote:

If we had an RSS output for everything, then IFTTT would be super easy.

— Reply to this email directly or view it on GitHub https://github.com/codeforamerica/project-ideas/issues/42#issuecomment-68916756 .

ondrae commented 9 years ago

You're correct again, using RSS would Tweet out erratically. Your suggestion is better.

urbildpunkt commented 9 years ago

Okay so far I have a Google Apps Script that pulls a random issue from the CFAPI and posts it to twitter. It can be set to run on time intervals or at specific times of day. Here is the example code.

I set it up at @civicissue.

ondrae commented 9 years ago

@urbildpunkt PERFECT. Thats a good twitter handle too.

A few notes:

ondrae commented 9 years ago

We'll also be adding Twitter handles eventually. We should include the Brigade's handle in the tweet once that is ready.

urbildpunkt commented 9 years ago

I was surprised to find the handle available. And yea I just set the timer to make sure the scheduling was working. Instead of setting an interval it would probably be better to just set it to post at a few specific times of the day.

You are right, randomly pulling an issue from a random list of issues is a bit redundant.

ondrae commented 9 years ago

Such good work @urbildpunkt I'll start promoting it now. Are you a member of a Brigade?

urbildpunkt commented 9 years ago

Thanks! @ondrae I haven't joined a Brigade yet but was looking for a way to start getting involved.

daguar commented 9 years ago

Good way to promote this — have the @codeforamerica Twitter account (re-)tweet some of these at strategic times. cc @Jaime-Alexis