charlestontechnology / people

7 stars 24 forks source link

Proposal: JSON all the things #16

Open jmar777 opened 8 years ago

jmar777 commented 8 years ago

This idea may be moot as I'm not sure what the grander vision is here, but I wanted to suggest the following:

[
  {
    "displayName": "Tom Wilson",
    "githubUsername": "twilson63",
    "twitterUsername": "twilson63"
  },
  {
    "displayName": "Jeremy Martin",
    "githubUsername": "jmar777",
    "twitterUsername": "jmar777"
  },
  ...
]

Motivation: because GitHub Pages now implicitly set CORS headers that allow access from anywhere, this could become a repo that would be useful for little mashup apps (e.g., a chstech twitter slack bot, a news feed for all chstech GH activity, etc.). While there may be some level of novelty/usefulness there by itself, I think it could further be useful as a primitive API for local meetups and developer classes, wherein students/attendees would be able to interact with some slightly more contextual data (albeit in a readonly fashion).

Thoughts?

twilson63 commented 8 years ago

@jmar777 imo all ideas are welcome here, the only grand vision is to have an index of the tech community that can be managed by the community, so that other sources may pull from, without being controlled by any one entity, i am happy to provide full ownership rights to all that want to see this community grow and sustain.

As far as your suggestion I think it is a great idea, @rgc had some similar thoughts, I would encourage others to weigh in as well. if this catches on and json all the things is the best way to sustain and provide value I will be happy to work on a conversion.

i took this approach mainly following examples like nodebots and the nodejs community organizing patterns, and to make it engaging to all, with the requirement of being capable of submitting a pull request. :)

jmar777 commented 8 years ago

@twilson63 That's a good point (re: avoiding barriers like git-specific familiarity). I just did a quick test on another repo, and it looks like the GitHub web UI allows editing JSON (and most other) file types as well, without any need for command line forking/pulling/pushing/etc., so maybe that's still an option?

I'm not too familiar with what nodebots and similar have done previously, though (I just remember when the node wiki used to actually catalog modules, lol...), so if there's some precedence and reasoning behind the current solution that's all good too. Just thinking out loud. 🤔

rgc commented 8 years ago

@jmar777 - yes, this is a good idea... i won't have time until the weekend, but i'm going to throw together a jekyll template that will generate per-user pages... I use yaml for my personal page, but json would be fine as well:

users:
 rgc:
  name: Rob Colantuoni
  email: rgc@colantuoni.com
  #tagline: "something interesting"
  # gravatar hash of email address
  gravatar: f3cebd26d058b00d6922f969c8f7d61d
  social:
    github: rgc
    twitter: rgc
    linkedin: robcolantuoni
    keybase: rgc
    #gplus: +RobertColantuoni
    #aboutme:
    #bitbucket:
    #hacker_news: 
    #stackexchange:
    #stackoverflow:
    #facebook:
    #tumblr:

@twilson63 - these user configs can also be used to generate consumable formats such as RSS, JSON, XML, etc... so that integration isn't affected.

rgc commented 8 years ago

also - suggest that we merge with: charlestontechnology so we don't duplicate effort.

twilson63 commented 8 years ago

@rgc

I recommend we just use github username and dynamically grab all other meta data via static site build from the github api, so data does not get stale.

RE: merge with charlestontechnology, I will reach out to Bill to see is thoughts, my only ask is that every member are empowered to manage the organization and repos, if he is cool with that and wants to merge I am happy to do so.

billmote commented 8 years ago

We do have charlestontechnology which holds the Code of Conduct and nothing else so far :) I had hoped to add a community accessible Hubot in there too.

twilson63 commented 8 years ago

@jmar777 - how about a pre-commit hook that parses the readme, and dynamically builds a people.json file from the github api, that way it is easy to access for folks, but it is always fresh data?

Just thinking out loud, here....

I like the readme having a list of people, and I also like the the idea of gh-pages, can we have both?

rgc commented 8 years ago

@jmar777, @twilson63 - about loading the items from github on the fly -- yes, it's possible and i added it to the first phase of the https://github.com/rgc/charlestontechnology.github.io site -- however since it's client side, it will run into rate-limiting issues.

this javascript will loop through DIVs, grab github userid and lazy-load their name, image, etc into fields in the DIV:

function load_github_profile(data) {
        console.log(data);
        var div_id = 'person-'+data.login;
        $('#'+div_id+' .person-img').attr('src',data.avatar_url);
        $('#'+div_id+' .person-name').html(data.name);
}

$( document ).ready(
        function() {
                $('.person-github').each(function(){
                        var api_url = '//api.github.com/users/' + $(this).attr('data-github');
                        $.getJSON(api_url, {}, load_github_profile);
                });
        }
);

However, since github only allows something like 60 calls per hour, if someone refreshes the page multiple times it will rate-limit them and nothing will appear.

twilson63 commented 8 years ago

I'm not familiar with jekyl but maybe we could add some sort of pre-commit hook that generates the Json before they github pages deploy is run?

Sent from my iPhone

On Jun 17, 2016, at 9:43 AM, Rob Colantuoni notifications@github.com wrote:

@jmar777, @twilson63 - about loading the items from github on the fly -- yes, it's possible and i added it to the first phase of the https://github.com/rgc/charlestontechnology.github.io site -- however since it's client side, it will run into rate-limiting issues.

this javascript will loop through DIVs, grab github userid and lazy-load their name, image, etc into fields in the DIV:

function load_github_profile(data) { console.log(data); var div_id = 'person-'+data.login; $('#'+div_id+' .person-img').attr('src',data.avatar_url); $('#'+div_id+' .person-name').html(data.name); }

$( document ).ready( function() { $('.person-github').each(function(){ var api_url = '//api.github.com/users/' + $(this).attr('data-github'); $.getJSON(api_url, {}, load_github_profile); }); } ); However, since github only allows something like 60 calls per hour, if someone refreshes the page multiple times it will rate-limit them and nothing will appear.

I'm looking for a better option right now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

heow commented 8 years ago

Before we start over-engineering this, let's consider why we're doing it in the first place. Can't we get all this user info from Meetup? They do have a nice API, the membership section of www.functional.sc uses it directly.