Coder Social home page Coder Social logo

jmealo / github-timeline-widget Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 3.0 354 KB

GitHub Timeline Widget allows you to embed your GitHub activity on an external website. It's written in Vanilla JS and requires no external libraries.

License: Other

CSS 34.09% JavaScript 65.91%

github-timeline-widget's Introduction

GitHub Timeline Widget

ATTENTION: Sorry folks, GitHub discontinued the API that this widget uses. Feel free to fork and update to the new API :)

The GitHub Timeline Widget allows you to embed your GitHub activity on an external website. It’s Vanilla JS and doesn’t require any libraries.

The size of the JavaScript and CSS stylesheet are:

  • Minified: ~9KB
  • Minified & GZipped: ~4KB

Live Demo: http://jeffreymealo.com/

The widget uses the GitHub font as described in the latest GitHub Style Guide.

Screenshot
Screenshot of GitHub Timeline Widget

Steps To Add To Your Website

1. Include the stylesheet: github-timeline-widget.min.css

<link rel="stylesheet" type="text/css" href="github-timeline-widget.min.css">

2. Create a <div> element on your page to hold the widget:

<div id="github-timeline-widget"></div>

3. Include the following code snippet:

<script type="text/javascript" src="github-timeline-widget.min.js"></script>
<script type="text/javascript">
//Call this after the DOM is loaded (see note following snippet)
  GitHubTimeline({
    username: '<YOUR GITHUB USERNAME!>',
    limit: 5,
    header: 'octocat',
    id: 'github-timeline-widget',
    exclude: ['gist'],
    callback: function () { //code to run once widget is inserted into DOM }
  });
</script>

I don’t include a Document Loaded/DOM Ready event to avoid duplicate code. Feel free to use your favorite JS library or try out the cross-browser example here: http://javascript.info/tutorial/onload-ondomcontentloaded.

Options:

  • username: [string] GitHub username
  • limit: [number] number of activities to show [default: 5]
  • header: [string/bool]
    1. ‘octocat’: header with octocat and username [default]
    2. true: header (username only)
    3. false: no header
  • exclude: [array of strings] activities that contain one of these strings will not appear in the widget
  • callback: [function] called when the widget has been inserted into the DOM

Custom Styling:
Use the CSS classes github-timeline-header to style the header text (defaults to “lucidia grande” 14px bolder black) and github-timeline-event-text:link to style the text (defaults to “lucidia grande” 12px black).

See the github-timeline-widget.css file for all classes.

Bitdeli Badge

github-timeline-widget's People

Contributors

jmealo avatar

Stargazers

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

Watchers

 avatar  avatar

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.