5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MashupAwardsヒーローズ・リーグAdvent Calendar 2018

Day 7

爆速でアイデアをパクる!1時間でハッカソン横断検索ツールできたよ

Last updated at Posted at 2018-12-23

TL;DR

世界中のハッカソンのプロジェクトを横断検索できるよ!
http://hackathons.hiroga.cc.s3-website-us-east-1.amazonaws.com/

種明かし

実はサーバー側の処理は全くありません。
Googleの site: 検索クエリを自動生成してくれるだけの簡単なサイトです。

ソースコード抜粋

(リポジトリ: https://github.com/hiroga-cc/hackathons)

const URLS = [
  "https://www.hackster.io/projects",
  "https://hackdash.org/projects",
  "https://devpost.com/software",
  "spaceappschallenge.org/project",
  "http://www.hackathon.io/projects",
  "https://protopedia.net/prototype"
];

const search_projects = function() {
  const head = "https://www.google.com/search";

  const keywords = $("#keywords")
    .val()
    .split(" ")
    .reduce((word, words) => words + "+" + word);

  const sites = URLS.map(url => "site:" + url)
    .map(url => encodeURIComponent(url))
    .reduce((site, current_sites) => current_sites + "+OR+" + site);

  const url = head + "?q=" + keywords + "+" + sites;
  console.log(url);
  // こうなります。
  // https://www.google.com/search?q=health+food+site%3Ahttps%3A%2F%2Fprotopedia.net%2Fprototype+OR+site%3Ahttp%3A%2F%2Fwww.hackathon.io%2Fprojects+OR+site%3Aspaceappschallenge.org%2Fproject+OR+site%3Ahttps%3A%2F%2Fdevpost.com%2Fsoftware+OR+site%3Ahttps%3A%2F%2Fhackdash.org%2Fprojects+OR+site%3Ahttps%3A%2F%2Fwww.hackster.io%2Fprojects
  window.open(url);
};

あとがき

他にもハッカソンのプロジェクトまとめサイトあったら教えてくださいね〜!

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?