Integrate GitHub API to Export Snippets as Gists

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github, javascript

Research direction

Start by locating the snippet cards and their .snippet-actions container, then inspect how snippets and localStorage are currently handled. Implement the Share to Gist flow with the GitHub REST API, token prompt and storage, success text, and a new-tab Gist link; done means the described behavior works for a snippet.

Written by the indexing model from the issue text.

Description

enhancement hard SourceSprint '26

⚠️ Competition Only
This issue was created exclusively for participants of SourceSprint'26, an open-source competition held at VIT Vellore.
Pull requests submitted for this issue will only be accepted from registered SourceSprint'26 participants. Pull requests from others will be closed without review.

Description

CodeVault is great for local storage, but sometimes developers need to share a snippet with a team or link it in a forum. We should add a "Share to Gist" button on the snippet cards that uses the GitHub REST API to automatically create a secret GitHub Gist containing the snippet's code.

Expected Behavior

  • Add a new button to the .snippet-actions container.
  • When clicked, the app should prompt the user for a GitHub Personal Access Token (PAT) if they haven't provided one yet, and save it in localStorage securely.
  • Use the JavaScript fetch() API to send a POST request to [https://api.github.com/gists](https://api.github.com/gists) with the snippet's title and code.
  • Upon success, change the button text to "Gist Created!" and open the new Gist link in a new tab.
Dominant language
JavaScript
Stars
0
Forks
20
Avg merge
25m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IEEE-VIT/code-block

All issues in IEEE-VIT/code-block

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.