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

Licenses content #1

Closed
wants to merge 3 commits into from
Closed

Licenses content #1

wants to merge 3 commits into from

Conversation

danielhusar
Copy link
Contributor

Hey, I have added licenses content because it looks useful to me, but Im not sure if you want it also so feel free to ignore this :)

var request = require('request');
var cheerio = require('cheerio');
var ent = require('ent');
var url = 'http://spdx.org/licenses/';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get all the licenses in go from here: http://git.spdx.org/license-list.git

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't know about that repository, I will change it to get data from there.

@sindresorhus
Copy link
Owner

Hah, yeah I intended too, just couldn't decide on how to embed them, so I deferred it.

Options:

  1. Files in a folder like you've done
  2. Same as above, but also load them into memory on require-time for ease of use.
  3. Embedded as text in the spdx.json
  4. Embedded but separate JSON file.

Opinions?

@sindresorhus
Copy link
Owner

Should also include the license link (eg. http://www.opensource.org/licenses/MIT) in the spdx.json file. But that can be done separately to this.

@danielhusar
Copy link
Contributor Author

I probably prefer 1 or 2 :)

@sindresorhus
Copy link
Owner

How about precomputing two JSON files, one minimal spdx.json with just the metadata (including link to the license), and one spdx-full.json that also includes the licenses (which would be the one we use in Node)?

}
});
});
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit fragile. Easier to just download the file with all the licenses: http://git.spdx.org/?p=license-list.git;a=snapshot;h=HEAD;sf=tgz

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use https://github.com/kevva/download instead of request to easily just fetch and untar it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree that its fragile :/ But that link contains all the licenses with git metadata so it might be hard to parse it for specific license.

What about just cloning that git repository? http://git.spdx.org/license-list.git (but Im not sure if its good idea to call it form node and also it will create another git repository inside this one)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that link contains all the licenses with git metadata so it might be hard to parse it for specific license.

Uhm, why? You just untar it. I just did on my Mac and it extracted into a folder with all the licenses as files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry you are right (stupid unrarchiver)

@sindresorhus
Copy link
Owner

Thanks :)

This was referenced Aug 17, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants