Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an auto-updating content calendar #2

Open
chartgerink opened this issue Feb 20, 2024 · 0 comments
Open

Add an auto-updating content calendar #2

chartgerink opened this issue Feb 20, 2024 · 0 comments

Comments

@chartgerink
Copy link
Member

chartgerink commented Feb 20, 2024

We started using GitHub projects recently to help consolidate some of our data collection and make GitHub more of a place of consensus. See for example our recent community events calendar or our ResearchEquals User Stories project.

We are looking to add a project that keeps track of content we produce, so that we can more easily assess our activity throughout the internet. The goal is to provide a consolidated history of our activity, that we can forget about until we need it.

It appears that we can do this through API queries, utilizing the new GraphQL endpoint. In NodeJS, it would look something like this (based off of these docs):

const fetch = require('node-fetch');

const token = 'token'; // Replace with your GitHub token
const url = 'https://api.github.com/graphql';

const query = `
{
  viewer {
    login
    email
  }
}
`;

const mutation = `
mutation {
    addProjectV2DraftIssue(input: {projectId: "PROJECT_ID" title: "TITLE" body: "BODY"}) {
      projectItem {
        id
      }
    }
  }
`;

const options = {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ query })
};

fetch(url, options)
  .then(response => response.json())
  .then(data => console.log(JSON.stringify(data, null, 2)))
  .catch(error => console.error('Error:', error));

We could integrate this with various of our data sources in Pipedream, a service we use for our automations. Our data sources could include:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant