Coder Social home page Coder Social logo

octonews's Introduction

octonews

A collaborative link sharing platform

Find out about the motivation and ideas for the project in ORIGIN.md

Octonews is a website rendered by Jekyll and is easy to publish to GitHub Pages. People can share links through pull requests by adding files to the _data/news folder. Instead of editing the YAML files directly, Octonews has a custom HTML form to submit links and is talking to the GitHub API to create the pull-requests automagically without people even knowing about it. All it takes is logging in with their GitHub account, which is built into Octonews, too.

The Octonews JavaScript API

All GitHub API calls are abstracted away in a higher-level API, which is implemented in [assets/octonews.js]. The Octonews object is accessible globally everywhere on the website.

Account APIs

Examples

if (Octonews.isSignedIn()) {
  // user is signed in
}

Octonews.set(key, value)
Octonews.get(key)
Octonews.unset(key)

Octonews.signIn() // redirects to GitHub to sign in
Octonews.signOut()

// fetch current user’s account information
Octonews.fetchAccount()

// fetch current user’s account information using single-use code & state
// query parameter from the GitHub OAuth redirect
Octonews.fetchAccount({code, state})
  .then(({token, scope, login, avatarUrl}) => {
    //
  })

// submit a link
Octonews.submitLink({url, tile})

// load pending link submissions
Octonews.getPendingLinks()

License

Apache 2.0

octonews's People

Contributors

gr2m avatar gr2m-test avatar jimthoburn avatar richardlitt avatar stefanmiodrag avatar tayvill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

octonews's Issues

Add License

There isn't one? Same for Code of Conduct.

Add reactions

This is just for reference for my self: a GraphQL query to load reactions for merged pull requests with the octonews label

{
  repository(owner: "octonews", name: "octonews") {
    name
    pullRequests(first: 100, states: MERGED, labels: ["octonews"], orderBy: {field:CREATED_AT, direction:DESC}) {
      pageInfo {
        endCursor
      }
      edges {
        cursor
        node {
          title
          reactions(content: HEART) {
            totalCount
            viewerHasReacted
          }
        }
      }
    }
  }
}

This doesn’t give us the information if I voted up the current news or not, but it’s a start

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.