Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pysearch/harvester/spiders/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from scrapy.spiders import Rule, CrawlSpider
from scrapy.item import Item, Field

CRAWL_COUNT = 10
DEPTH_LEVEL = 10


class MyItem(Item):
"""Item container for scraping."""
Expand Down Expand Up @@ -53,7 +56,8 @@ def crawl(url):
"""To crawl."""
settings = get_project_settings()
settings.url = url
settings["CLOSESPIDER_PAGECOUNT"] = 10
settings["CLOSESPIDER_PAGECOUNT"] = CRAWL_COUNT
settings["DEPTH_LEVEL"] = DEPTH_LEVEL
process = CrawlerProcess(settings)

class ThisSpider(CrawlingSpider):
Expand Down
1 change: 1 addition & 0 deletions pysearch/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ def includeme(config):
config.add_route('loading', '/loading')
config.add_route('computing_results', '/computing_results')
config.add_route('results', '/results')
config.add_route('about', '/about')

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pysearch/static/bootstrap-3.3.7-dist/css/bootstrap.min.css

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion pysearch/static/circle.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.circle {
display: None;
}
}

#search-box{
width: 80%;
}
#search-button{
width: 15%;
}


Binary file added pysearch/static/dashinfinity.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions pysearch/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.result-heading {
font-size: 1.5em;
}

a.result-heading:link {
color: white;
}

a.result-heading:visited {
color: silver;
}

a.result-heading:hover {
color: #829255;
}

a.result-heading:active {
color: orange;
}

#result-title{
font-size: 4em;
}

.topBar{
margin-top: 2%;
}

.search-url{
font-size: 2em;
}

.jumbotron {
padding: 0.5em 0.6em;
h1 {
font-size: 2em;
}
p {
font-size: 1.2em;
.btn {
padding: 0.5em;
}
}
}

#footer{
margin-top: 15%;
}
50 changes: 50 additions & 0 deletions pysearch/templates/about.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% extends "layout.jinja2" %}

{% block nav %}

<nav class="navbar ">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="myNavbar">

<div class="col-lg-9"></div>
<ul class="nav navbar-nav topBar">
<li class="active"><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
<div class="col-lg-2"></div>

</div>
</div>
</nav>
{%endblock%}


{% block body %}
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Marc Fieser</div>
<div class="panel-body"><img src="../static/about/marc.jpg" class="img-responsive" style="width:100%" alt="Image"></div>
<div class="panel-footer">My name is Marc, and was born and raised nearby in Woodinville, WA. I spent 9 years in the US Army and have a computer science degree from University of Washington. I am a Python Developer.</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Ben Shields</div>
<div class="panel-body"><img src="https://placehold.it/150x80?text=IMAGE" class="img-responsive" style="width:100%" alt="Image"></div>
<div class="panel-footer">Hi, I am Ben.</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Sera Smith</div>
<div class="panel-body"><img src="https://placehold.it/150x80?text=IMAGE" class="img-responsive" style="width:100%" alt="Image"></div>
<div class="panel-footer">Hi, I am Sera</div>
</div>
</div>
</div>
</div><br><br>


{%endblock%}
78 changes: 42 additions & 36 deletions pysearch/templates/home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,54 @@

{% block title %}Home{% endblock %}

{% block body %}
{% block nav %}
<nav class="navbar Navbar">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="myNavbar">
<div class="col-lg-9"></div>
<ul class="nav navbar-nav topBar">
<li><a href="/about">About</a></li>
</ul>
<div class="col-lg-2"></div>

</div>
</div>
</nav>
{%endblock%}

{% block body %}
<link rel="stylesheet" href="../static/circle.css" type="text/css">

<div class="header-right">
<div class="search-bar">
<form method="post">
<input id="search-box" type="text" name="url">
<input id="search-button" type="submit" value="Search">
</form>
<div class="jumbotron">
<div class="container text-center">
<h1>Pysearch</h1>
<p>Search Engine for the New Era</p>
</div>
</div>
<div class="clearfix"></div>
<!-- script-for-menu -->
{# <script>
$("span.menu").click(function(){
$(" ul.navig").slideToggle("slow" , function(){
});
});
</script> #}

<img class="circle" src="../static/ladng_cricle.gif">

<div class="container-fluid text-center">
<div class="row content">
<div class="col-sm-2 sidenav">
</div>
<div class="col-sm-8 text-left">
<div class="search-bar">
<form method="post">
<input id="search-box" type="text" name="url">
<input id="search-button" type="submit" value="Search">
</form>
</div>
</div>
<div class="col-sm-2 sidenav">
</div>
</div>
</div>

<div class="clearfix"></div>
</body>
</html>
<div class="container text-center">
<img class="circle" src="../static/dashinfinity.gif">
</div>
</div>

{% endblock %}

Expand All @@ -37,21 +61,3 @@
<script src="../static/loading.js"></script>

{% endblock %}


{#
{% block body %}
<body>
{% for result in RESULTS %}
<div>
<h2>{{ result.title }}</h2>
<h1>a href="{{ result.url }}">View Result Page</a></h1>
<p>{{ result.body }}</p>
<div>
<a href="{{ request.route_url('results', id=result.id) }}">Read More</a>
</div>
</div>
{% endfor %}
</body>
{% endblock %}
#}
43 changes: 10 additions & 33 deletions pysearch/templates/layout.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,23 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="author" content="Ben S., Marc F., Sera S.">
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- <script src="js/jquery.min.js"></script> -->
<!-- <link rel="stylesheet" href="{{ request.static_url('pysearch:static/style.css') }}" type="text/css"> -->
<link href="{{ request.static_path('pysearch:static/bootstrap-3.3.7-dist/css/bootstrap.min.css') }}" rel="stylesheet" />
<link href="{{ request.static_path('pysearch:static/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css') }}" rel="stylesheet" />
<link href="{{ request.static_path('pysearch:static/style.css')}}" rel="stylesheet" type="text/css">
</head>

<!--banner-starts-->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/">Home</a>
</li>
<li>
<a href="results">Results</a>
</li>
<li>
<a href="loading">Loading</a>
</li>
<li>
<a href="computing_results">Computing Results</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div class="banner">
<div class="container">
<div class="banner-top">
<div class="banner-text">
<h2>PySearch</h2>
<h1>:: Search Engine for the New Era ::</h1>
</div>
</div>
</div>
</div>

{%block nav%}
{%endblock%}
<!--banner-end-->

<!--body-->
{% block body %}
{% endblock %}
<!--body-end-->
<footer id = footer class="container-fluid text-center">
<p>Pysearch &copy 2017</p>
</footer>

<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
Expand All @@ -57,4 +33,5 @@
{% block javascript %}
{% endblock %}

</html>
</html>

Loading