first commit

This commit is contained in:
Kevin Lynx 2013-07-01 22:42:14 +08:00
commit 4f7fe8805e
51 changed files with 213 additions and 0 deletions

18
README.md Normal file
View File

@ -0,0 +1,18 @@
## dhtcrawler2
This git branch maintain pre-compiled erlang files to start dhtcrawler2 directly.
## Usage
* install Erlang R16B or newer
* download mongodb and start mongodb first
mongod --dbpath your-database-path --setParameter textSearchEnabled=true
* start **crawler**, on Windows, just click `win_start_crawler.bat`
* start **hash_reader**, on Windows, just click `win_start_hash.bat`
* start **httpd**, on Windows, just click `win_start_http.bat`
* wait several minutes and checkout `localhost:8000`

16
create_bin.bat Normal file
View File

@ -0,0 +1,16 @@
cd ..
mkdir bin\deps\bson\ebin
mkdir bin\deps\mongodb\ebin
mkdir bin\deps\kdht\ebin
mkdir bin\deps\ibrowse\ebin
copy deps\bson\ebin\*.* bin\deps\bson\ebin\
copy deps\mongodb\ebin\*.* bin\deps\mongodb\ebin\
copy deps\kdht\ebin\*.* bin\deps\kdht\ebin\
copy deps\ibrowse\ebin\*.* bin\deps\ibrowse\ebin\
mkdir bin\www
copy www\*.* bin\www\
copy tools\*.* bin\
mkdir bin\priv
mkdir bin\ebin
copy ebin\*.* bin\ebin\
pause

7
deps/bson/ebin/bson.app vendored Normal file
View File

@ -0,0 +1,7 @@
{application, bson,
[{description, "BSON are JSON-like objects with a standard binary serialization. See bsonspec.org."},
{vsn, "0"},
{modules, [bson, bson_binary, bson_tests]},
{registered, []},
{applications, [kernel, stdlib]}
]}.

BIN
deps/bson/ebin/bson.beam vendored Normal file

Binary file not shown.

BIN
deps/bson/ebin/bson_binary.beam vendored Normal file

Binary file not shown.

BIN
deps/bson/ebin/bson_tests.beam vendored Normal file

Binary file not shown.

9
deps/ibrowse/ebin/ibrowse.app vendored Normal file
View File

@ -0,0 +1,9 @@
{application,ibrowse,
[{description,"Erlang HTTP client application"},
{vsn,"4.0.1"},
{registered,[ibrowse_sup,ibrowse]},
{applications,[kernel,stdlib]},
{env,[]},
{mod,{ibrowse_app,[]}},
{modules,[ibrowse,ibrowse_app,ibrowse_http_client,ibrowse_lb,
ibrowse_lib,ibrowse_sup]}]}.

BIN
deps/ibrowse/ebin/ibrowse.beam vendored Normal file

Binary file not shown.

BIN
deps/ibrowse/ebin/ibrowse_app.beam vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
deps/ibrowse/ebin/ibrowse_lb.beam vendored Normal file

Binary file not shown.

BIN
deps/ibrowse/ebin/ibrowse_lib.beam vendored Normal file

Binary file not shown.

BIN
deps/ibrowse/ebin/ibrowse_sup.beam vendored Normal file

Binary file not shown.

1
deps/kdht/ebin/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.beam

10
deps/kdht/ebin/kdht.app vendored Normal file
View File

@ -0,0 +1,10 @@
{application, kdht, [
{description, "DHT library"},
{vsn, git},
{registered, []},
{applications, [kernel, stdlib]},
{modules, [bencode, bucket, dht_id, dht_net, dht_state, kdht_sup, msg,
search, storage, timer_monitor, vlog]},
{mod, {}}
]}.

BIN
deps/mongodb/ebin/mongo.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_app.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_connection.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_cursor.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_id_server.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_pool.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_protocol.beam vendored Normal file

Binary file not shown.

BIN
deps/mongodb/ebin/mongo_sup.beam vendored Normal file

Binary file not shown.

9
deps/mongodb/ebin/mongodb.app vendored Normal file
View File

@ -0,0 +1,9 @@
{application,mongodb,
[{description,"Client interface to MongoDB, also known as the driver. See www.mongodb.org"},
{vsn,"v0.3.1-96-g613f157"},
{registered,[]},
{applications,[kernel,stdlib,bson]},
{mod,{mongo_app,[]}},
{modules,[mongo,mongo_app,mongo_connection,mongo_cursor,
mongo_id_server,mongo_pool,mongo_protocol,
mongo_sup]}]}.

BIN
ebin/bt_conn.beam Normal file

Binary file not shown.

BIN
ebin/bt_message.beam Normal file

Binary file not shown.

BIN
ebin/crawler_app.beam Normal file

Binary file not shown.

BIN
ebin/crawler_http.beam Normal file

Binary file not shown.

BIN
ebin/crawler_stats.beam Normal file

Binary file not shown.

BIN
ebin/crawler_sup.beam Normal file

Binary file not shown.

BIN
ebin/db_hash.beam Normal file

Binary file not shown.

BIN
ebin/db_hash_reader.beam Normal file

Binary file not shown.

Binary file not shown.

BIN
ebin/db_store_mongo.beam Normal file

Binary file not shown.

BIN
ebin/db_system.beam Normal file

Binary file not shown.

BIN
ebin/dht_monitor.beam Normal file

Binary file not shown.

13
ebin/dhtcrawler.app Normal file
View File

@ -0,0 +1,13 @@
{application,dhtcrawler,
[{description,"A DHT crawler to index magnet hash to torrent"},
{vsn,"6dde34b"},
{registered,[dht_crawler_sup]},
{applications,[kernel,stdlib,crypto,public_key,ssl,inets,bson,
mongodb]},
{mod,{crawler_app,[]}},
{modules,[bt_conn,bt_message,crawler_app,crawler_http,
crawler_stats,crawler_sup,db_hash,db_hash_reader,
db_hash_reader_sup,db_store_mongo,db_system,
dht_monitor,hash_reader_stats,http_handler,
string_split,time_util,tor_download,
tor_download_stats,torrent_file,urldecode,vlog]}]}.

BIN
ebin/hash_reader_stats.beam Normal file

Binary file not shown.

BIN
ebin/http_handler.beam Normal file

Binary file not shown.

BIN
ebin/string_split.beam Normal file

Binary file not shown.

BIN
ebin/time_util.beam Normal file

Binary file not shown.

BIN
ebin/tor_download.beam Normal file

Binary file not shown.

Binary file not shown.

BIN
ebin/torrent_file.beam Normal file

Binary file not shown.

BIN
ebin/urldecode.beam Normal file

Binary file not shown.

BIN
ebin/vlog.beam Normal file

Binary file not shown.

2
win_start_crawler.bat Normal file
View File

@ -0,0 +1,2 @@
erl -pa ebin -noshell -s crawler_app start

1
win_start_hash.bat Normal file
View File

@ -0,0 +1 @@
erl -pa ebin -noshell -s db_hash_reader_sup start_standalone localhost 27017 10

2
win_start_http.bat Normal file
View File

@ -0,0 +1,2 @@
erl -pa ebin -noshell -s crawler_http start

66
www/index.html Normal file
View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Yet Another Magnet Search Engine</title>
<style type="text/css" media="screen">
body { margin:0; padding:0; }
#wrap {
width: 980px;
margin: 5px auto;
}
#header {
height: 30px;
}
#main {
margin: 20px 10px;
}
#content {
min-height: 130px;
padding: 20px 5px;
}
#footer{
text-align:center;
font-size: 13px;
margin-top: 20px;
padding-top: 5px;
border-top: 1px solid #888;
}
.search-box #s_text {
width: 200px;
}
</style>
</head>
<body>
<div id="wrap">
<div id="header">
<h2><a style="text-decoration:none;" href="/">Magnet Search Engine</a></h2>
</div>
<div id="main">
<div class="search-box">
<form id="s_box" method="get" action="/e/http_handler:search" >
<input id="s_text" name="q" type="text" />
<input id="s_submit" value="Search" type="submit" />
</form>
</div>
<div id="content">
<p>
Try <a href="/e/http_handler:search?q=avi">AVI</a>
&nbsp;<a href="/e/http_handler:search?q=american">American</a>
&nbsp;<a href="/e/http_handler:search?q=iron+man">Iron Man</a>
</p>
</div>
<div id="footer">
<a href="/e/http_handler:recent">New</a>
<a href="/e/http_handler:top">Top</a>
<a href="/e/http_handler:stats">Stats</a>
<span> &copy; Kevin Lynx 2013</span>
</div>
<script type="text/javascript">
document.getElementsByTagName('input')[0].focus();
</script>
</div>
</div>
</body>
</html>

59
www/page.temp Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Yet Another Magnet Search Engine</title>
<style type="text/css" media="screen">
body { margin:0; padding:0; }
#wrap {
width: 980px;
margin: 5px auto;
}
#header {
height: 30px;
}
#main {
margin: 20px 10px;
}
#content {
min-height: 130px;
padding: 20px 5px;
}
#footer{
text-align:center;
font-size: 13px;
margin-top: 20px;
padding-top: 5px;
border-top: 1px solid #888;
}
.search-box #s_text {
width: 200px;
}
</style>
</head>
<body>
<div id="wrap">
<div id="header">
<h2><a style="text-decoration:none;" href="/">Magnet Search Engine</a></h2>
</div>
<div id="main">
<div class="search-box">
<form id="s_box" method="get" action="/e/http_handler:search" >
<input id="s_text" value="~s" name="q" type="text" />
<input id="s_submit" value="Search" type="submit" />
</form>
</div>
<div id="content">
~s
</div>
<div id="footer">
<a href="/e/http_handler:recent">New</a>
<a href="/e/http_handler:top">Top</a>
<a href="/e/http_handler:stats">Stats</a>
<span> &copy; Kevin Lynx 2013</span>
</div>
</div>
</div>
</body>
</html>