GithubHelp home page GithubHelp logo

autoimport about ext-github-release-notifier HOT 2 CLOSED

crimx avatar crimx commented on July 16, 2024
autoimport

from ext-github-release-notifier.

Comments (2)

crimx avatar crimx commented on July 16, 2024

Hi I don't have time to write it now but you can hack it. Generate the data in the following manner (Only name is required). Copy everything, open the background page and run it in the console. If you want to see the updated results right away, open the browser action popup panel and hit "check now".

/**
 * @property {string} name - repo name [owner]/[repo]
 * @property {string} watching - 'major', 'minor' or 'all'
 * @property {string} method - 'api' or 'atom'
 */

const data = [
  {
    name: 'crimx/ext-github-release-notifier',
    watching: 'all',
    method: 'api',
  },
  {
    name: 'JohnAlbin/normalize-scss',
  },
  {
    name: 'hyperfuse/react-anime',
    method: 'atom',
  },
  // ...
]

// Just copy and paste
function genStore ({repos = []}) {
  repos.push(...data.map(x => x.name))
  const store = data.reduce((o, d, i) => {
    if (!d.name) {
      console.warn(`skip item ${i}`)
      return o
    }

    o[d.name] = Object.assign({
      watching: 'all',
      method: 'atom',
      etag: '',
      last_modified: '',
      avatar_url: '',
      author_url: '',
      published_at: 0,
      html_url: '',
      tag_name: '',
      zipball_url: '',
      tarball_url: '',
      assets: [],
    }, d)
    
    return o
  }, {})
  store.repos = [...new Set(repos)]
  return store
}

if (window.browser) {
  browser.storage.sync.get('repos')
    .then(genStore)
    .then(store => browser.storage.sync.set(store))
} else {
  chrome.storage.sync.get('repos', res => {
    chrome.storage.sync.set(genStore(res))
  })
}

from ext-github-release-notifier.

skapytek avatar skapytek commented on July 16, 2024

Thank you!

from ext-github-release-notifier.

Related Issues (12)

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.