Coder Social home page Coder Social logo

api's Introduction

What is OctoLinker?

OctoLinker is a browser extension for GitHub, that turns language-specific statements like include require or import into links.

Install

Trusted by over 30,000 developers! Install OctoLinker from Chrome Web Store, Mozilla Add-ons Store, Mac App Store, Microsoft Store and Opera Add-ons Store.

Special thanks to

Sponsors

β–² Vercel Memetria complex

I am truly grateful to all the wonderful humans and companies supporting the development of OctoLinker. Please consider donations through GitHub Sponsors or Open Collective – Thank you πŸ™‡β€β™‚οΈ

Privacy Policy

Our Privacy Policy describes our practices related to the use, storage and disclosure of information we collect when you're using our service.

Related

Disclaimer

OctoLinker is not affiliated with, sponsored by, or endorsed by GitHub Inc.

Copyright (c) 2014–present Stefan Buck and other contributors.

api's People

Contributors

auto-merge-app[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar joseph-onsip avatar josephfrazier avatar stefanbuck avatar xt0rted avatar yoyosource avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

Add support for R packages (CRAN)

In OctoLinker/OctoLinker#1037 @edavidaja offered help to get OctoLinker work with R.

R packages are hosted by Comprehensive R Archive Network (CRAN). A web version of each package manifest is available at the link: https://cran.r-project.org/package={package} (e.g. https://cran.r-project.org/package=flextable)

Packages with web pages list them in the URL field of the DESCRIPTION file; however, not all packages have a webpage. There is a GitHub Mirror of CRAN packages at https://github.com/cran, which has the source code, including the manifest, for any package on CRAN.

First we need to figure out wether or not CRAN has an endpoint that returns a JSON document so we can leverage our universal config which makes adding new registry support super easy.

So, does CRAN have such an endpoint @edavidaja ?

Hovercard urls are case sensitive

While adding support for nuget.org I ran into a few packages where the github url associated with it is lowercase and the hovercard endpoint returns a 404 and breaks the UI.

Recently most of the aspnet/* repos were rolled into the dotnet org so if you go to their old url github redirects you (for example https://github.com/aspnet/scaffolding now goes to https://github.com/dotnet/scaffolding).

For Microsoft.VisualStudio.Web.CodeGeneration.Tools we resolve to https://github.com/aspnet/scaffolding but the original repo name was Scaffolding. The hovercard endpoint we're building is https://github.com/aspnet/scaffolding/hovercard but these endpoints are case sensitive for some reason so it doesn't resolve and redirect to https://github.com/dotnet/Scaffolding/hovercard as expected. If you change the repo name to Scaffolding it will resolve and redirect.

I'm wondering if we should add an extra check before caching the url so if it's for github we hit their api and get the correctly cased url and then use that.

Rewrite resolver api so adding new registry would be super easy

The current state

If you want to add a new registry, you have to add a new endpoint. This is already quite easy (especially if the API is well designed e.g bower).

First, you make a call to the registry with the given package name. Then the registry returns the meta information for the package wich contains somewhere the project github url. Sometimes this is just a git url git://github.com/jquery/jquery-dist.git, so we have to convert the git url to a github url https://github.com/jquery/jquery-dist. Finally we can respond with the github url for the requested project.

The idea

It's the same flow for every registry, therefore I would like to have a generic endpoint. This endpoint would ideally be configured from a json file. The json file would contain all information that is needed to extract the github url from a registry response.

bower

 "bower": {
    "registry": "http://bower.herokuapp.com/packages/{{name}}",
    "fallback": "http://bower.io/search/?q={{name}}",
    "xpaths": [
      "url"
    ]
  }

rubygems

  "rubygems": {
    "registry": "https://rubygems.org/api/v1/gems/{{name}}.json",
    "fallback": "https://rubygems.org/gems/{{name}}",
    "xpaths": [
      "source_code_uri",
      "documentation_uri"
    ]
  }

npm

... if the registry is more flexible

  "npm": {
    "registry": "https://registry.npmjs.org/{{name}}",
    "fallback": "https://npmjs.org/package/{{name}}",
    "xpaths": [
      "url",
      "repository",
      "repository.url",
      "repository.path",
      "repository.web",
      "repository.git",
      "repositories",
      "repositories.url",
      "repositories.path",
      "repositories.web",
      "repositories.git",
      "homepage",
    ]
  }

Do you like the idea? Any concerns or other ideas? If you like to help, please leave a message below so I can get in touch with you.

Upgrade hapijs

In Hapi 17 the entire api has moved away from callbacks and toward async/await. This is really great, but makes migrating a little bit harder. They provide a migration checklist so it's shouldn't be that complicated, hopefully just a little time consuming 🀞

hapijs/hapi#3658

Unable to query successful response from server

It seems perhaps something is wrong on heroku, which has the downstream effect of breaking the octolinker extension.

Expected behavior: Querying the example url https://githublinker.herokuapp.com/q/bower/backbone returns the expected response.

Observed behavior: All queries seem to fail. A couple examples:

Some queries return an app-level 500 error:

$ curl -I https://githublinker.herokuapp.com/q/bower/backbone
HTTP/1.1 500 Internal Server Error
Server: Cowboy
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 96
Vary: accept-encoding
Date: Mon, 02 Oct 2017 20:31:41 GMT
Via: 1.1 vegur

$ curl https://githublinker.herokuapp.com/q/bower/backbone
{"message":"An internal server error occurred","statusCode":500,"error":"Internal Server Error"}% 

Some queries return a heroku-level 503 Service Unavailable error (30s timeout, I think):

$ curl -I https://githublinker.herokuapp.com/q/npm/browserify
HTTP/1.1 503 Service Unavailable
Connection: keep-alive
Server: Cowboy
Date: Mon, 02 Oct 2017 20:30:46 GMT
Content-Length: 506
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache, no-store

$ curl https://githublinker.herokuapp.com/q/npm/browserify
<!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>%             

Perhaps some configuration has gone stale? At any rate, thanks so much for providing this service/extension in the first place. Having it break makes me realize how much I ❀️ it.

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.