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

Website for searching in awesome. #427

Closed
lockys opened this issue Nov 26, 2015 · 25 comments
Closed

Website for searching in awesome. #427

lockys opened this issue Nov 26, 2015 · 25 comments

Comments

@lockys
Copy link
Contributor

lockys commented Nov 26, 2015

Hi, dear all
First, thank all authors of awesome list, it makes the world better.

I don't know that if there are similar projects for these.
I am trying to exact awesome lists into JSON in my leisure time(still working on it) and build a simple website for searching awesome. Hope it's a helpful thing :p

I am looking forward to someone to PR any awesome list in JSON format like this because the format of awesome lists are different so that it's not so easy to write a general program to extract them into JSON I think.

It's not an issue actually and can be closed undoubtedly.
if you get interested, below is the repos:
https://github.com/lockys/awesome-search

the JSON repo:
https://github.com/lockys/awesome.json

site:
https://awesomelists.top

tks.

@lockys lockys changed the title Website for search in awesome. Website for searching in awesome. Nov 26, 2015
@inputsh
Copy link

inputsh commented Nov 26, 2015

We've previously discussed about this, but you're actually the first one who started working on it! So, thanks!

@parro-it
Copy link
Contributor

Cool project!

@inputsh
Copy link

inputsh commented Nov 26, 2015

The problem I have with this JSON idea is that this list itself receives pull requests on a daily basis. It's pretty much impossible to even estimate the amount of changes happening on each and every list included here.

So, may I suggest that instead of manually adding JSON files you find some solution using GitHub's API? It might not be easy, but it definitely is necessary because manually implementing each and every change is a mission impossible.

@sindresorhus
Copy link
Owner

Should be possible to do some best-effort parsing of the Markdown. It's just sections and links, even though there are slight differences. I think that's a much better approach than trying to convince lots of people to manually maintain a JSON file.

@lockys
Copy link
Contributor Author

lockys commented Nov 27, 2015

@alejandronanez Thank for your constructive opinions.
@sindresorhus Yes, I agree with you. Writing a general program to parse them will be definitely better and more efficient than convincing people to contribute. Also, thank you for taking time to reply 👍

@sindresorhus
Copy link
Owner

@dthree and @wooorm have some experience with parsing Markdown and might be able to point you in the right direction.

@wooorm
Copy link

wooorm commented Nov 27, 2015

Thanks for the ping, @sindresorhus!

@lockys Cool project 👍 I’m building a tool called mdast which I think could help. mdast exposes a syntax tree for markdown.

I hacked this script together:

var fs = require('fs');
var mdast = require('mdast');
var toString = require('mdast-util-to-string');
var toc = /^((table of )?contents|packages)$/i;

mdast().use(function () {
  return function (ast) {
    var sections = {};
    var sectionName;
    var section;
    var contents;

    ast.children.forEach(function (node) {
      if (node.type === 'heading' && node.depth !== 1) { // Ignore first-level headings.
        contents = toString(node).trim();

        // Ignore TOC lists.
        if (!toc.test(contents)) {
          sectionName = contents;
          section = [];
        }
      } else if (section && node.type === 'list') {
        // set the section (only when followed by a list).
        sections[sectionName] = section;
        node.children.forEach(function (item) {
          // get the link in the paragraph in the list-item.
          var head = item.children[0].children[0];

          contents = toString(item).split(/-/);

          section.push({
            'name': contents[0].trim(),
            'description': contents.slice(1).join('').trim() || null,
            'url': head && head.type === 'link' ? head.href : null,
            'cate': sectionName
          });
        });
      }
    });

    console.log(JSON.stringify(sections, null, 2));
  }
}).process(fs.readFileSync('readme.md', 'utf-8'));

In the sindresorhus/awesome-nodejs repo, it produces your desired output (with descriptions added on top 😉):

{
  "Mad science": [
    {
      "name": "webtorrent",
      "description": "Streaming torrent client for Node.js and the browser.",
      "url": "https://github.com/feross/webtorrent",
      "cate": "Mad science"
    },
    {
      "name": "GitTorrent",
      "description": "Peertopeer network of Git repositories being shared over BitTorrent.",
      "url": "https://github.com/cjb/GitTorrent",
      "cate": "Mad science"
    },
    ...
    {
      "name": "RequireBin",
      "description": "Shareable JavaScript programs powered by npm and browserify.",
      "url": "http://requirebin.com",
      "cate": "Tools"
    },
    {
      "name": "Tonic",
      "description": "Embed a Node.js environment on any website.",
      "url": "http://blog.tonicdev.com/2015/09/30/embedded-tonic.html",
      "cate": "Tools"
    }
  ]
}

Now, I hope this helps you. I suggest checking out how mdast works (there are a lot of docs). Good luck, and ping me if you have any Qs 😄

@lockys
Copy link
Contributor Author

lockys commented Nov 27, 2015

@sindresorhus thanks for finding people who experiencing in markdown 😄
@wooorm mdast is pretty remarkable and helpful for me! It really reduces the pain of parsing markdown. I will try that! Thanks for your kindness and help 💯

@inputsh
Copy link

inputsh commented Nov 27, 2015

I have a coupon for a free .me domain that I could give to you for this project.

Unfortunately, awesome.me is currently taken, so if anyone has any ideas...

@gepser
Copy link

gepser commented Nov 27, 2015

@inputsh
Copy link

inputsh commented Nov 27, 2015

@gepser sounds good (and it's available). What do you think @lockys ?

@alejandronanez
Copy link
Contributor

@lockys
Copy link
Contributor Author

lockys commented Nov 27, 2015

@Aleksandar-Todorovic
wow, it's good. I love http://awesomelists.me as well.
I don't know how to express my gratitude, ha!
Thank for your generosity 😃

@inputsh
Copy link

inputsh commented Nov 27, 2015

Up and running on awesomelists.me.

Don't need to thank me, thank the people from Montenegro that gave me a coupon to their domain for free. I'm already using one (r3bl.me, so I had no idea what to do with it. 😄

Fun fact: .me is actually the biggest exporting product of the country of Montenegro.

@dthree
Copy link
Contributor

dthree commented Nov 27, 2015

👍 on using mdast. @wooorm did an excellent job and it's been working perfectly for me in complicated markdown parsing.

@lockys
Copy link
Contributor Author

lockys commented Nov 28, 2015

Thanks all you guys for helping this project 👍

@ghost
Copy link

ghost commented Nov 29, 2015

Wow amazing work bro

@Sljux
Copy link

Sljux commented Nov 29, 2015

Great work!

On Sun, Nov 29, 2015 at 3:34 PM, Deejavu notifications@github.com wrote:

Wow amazing work bro


Reply to this email directly or view it on GitHub
#427 (comment)
.

@RichardLitt
Copy link
Contributor

Actually, I talked to the guy who runs aweso.me, and he said he might be open to routing it over, as long as he still controls the domain. Just an option!

@lockys
Copy link
Contributor Author

lockys commented Dec 22, 2015

@RichardLitt Thank you :)
We have decided https://awesomelists.top as our final domain name.
BTW, Awesome Search is better than the previous version for now.
Also, we set a cron job to crawl every awesome list including the awesome repo every day.
Therefore, it will be up-to-date I think!
Take a look if you get interetsed :-)

@pokeball99
Copy link
Contributor

@lockys #470 maybe of use for finding list not on the main awsome list, but as @sindresorhus said, they may be incomplete or such

@lockys
Copy link
Contributor Author

lockys commented Jan 14, 2016

@pokeball99, thanks you for telling, I have checked your issue before.
But I would use sindresorhus/awesome as only source.
The reason is that the lists which @sindresorhus decided to put on awesome would be a more mature lists as you mentioned.

@kbk0125
Copy link

kbk0125 commented Aug 2, 2016

Hey, if anybody is still interested in this, I took my own crack at it! https://www.rtfmanual.io/awesome/. Used the x-ray package from Node to scrape the site. Happy to share the key code snippet if anybody is interested. It is nice and hacky. Inspired by this

@veggiemonk
Copy link
Contributor

I don't know if you might be interested in this, for awesome-docker i've done it like this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.1/fetch.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.5.4/showdown.min.js"></script>
<script>
      const converter = new showdown.Converter();
      const text      = fetch('https://raw.githubusercontent.com/veggiemonk/awesome-docker/master/README.md')
                        .then(res => res.text())
                        .catch(err => console.error(err))
                        .then( text => {
                          document.getElementById('md').innerHTML = converter.makeHtml(text);
                        });
</script>

For searching, a simple Ctrl-F or Cmd-F would work. It might not be UI friendly, but I don't think people looking for these kind of resources would mind. Let me know what you think and what kind of tradeoffs is worth it. Thanks

@sindresorhus
Copy link
Owner

We have a section for Awesome related tools now. Submit what you make there. https://github.com/sindresorhus/awesome#related :)

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

15 participants