Ravi Shah 5 years ago
parent
commit
bf7a126e91
  1. 6
      Web_Dashboard/app.py
  2. 1
      Web_Dashboard/js/redirect.js
  3. 2
      Web_Dashboard/templates/index.html
  4. 32
      Web_Dashboard/templates/rickroll.html
  5. 15
      readme.md

6
Web_Dashboard/app.py

@ -443,6 +443,10 @@ def ten():
return render_template('ten.html', smartphone=ten_smartphone, tablet=ten_tablet, laptop=ten_laptop) return render_template('ten.html', smartphone=ten_smartphone, tablet=ten_tablet, laptop=ten_laptop)
@app.route('/rickroll')
def index():
return render_template('rickroll.html')
if __name__ == '__main__': if __name__ == '__main__':
from waitress import serve from waitress import serve
serve(app, host="0.0.0.0", port=1235)
serve(app, host="0.0.0.0", port=1235)

1
Web_Dashboard/js/redirect.js

@ -0,0 +1 @@
setTimeout(() => { location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"; }, 1000);

2
Web_Dashboard/templates/index.html

@ -28,7 +28,7 @@
</head> </head>
<body> <body>
<div class="header"> <div class="header">
<a href="#" class="text">iFixit Repairability Dashboard</a>
<a href="https://github.com/Rav4s/iFixit-Repairability-Dashboard" class="text">iFixit Repairability Dashboard</a>
</div> </div>
<div class="row"> <div class="row">
<div class="column2" style="background-color:#040e1e; overflow: auto; scrollbar-width: thin; width: 100%;"> <div class="column2" style="background-color:#040e1e; overflow: auto; scrollbar-width: thin; width: 100%;">

32
Web_Dashboard/templates/rickroll.html

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex" />
<link href="static/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="static/styles.css" rel="stylesheet" media="screen">
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.yeetpc.com/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</head>
<body>
<title>Rickrolled!</title>
<h1>Rickrolled!</h1>
<script src="js/redirect.js"></script>
</body>
</html>

15
readme.md

@ -0,0 +1,15 @@
# iFixit-Repairability-Dashboard
Pulls repairability scores for various devices from iFixit, which are then displayed on a website in a few categories.
## What does each file do?
The scraper.py file scrapes iFixit's webpages at https://www.ifixit.com/smartphone-repairability, https://www.ifixit.com/laptop-repairability, and https://www.ifixit.com/tablet-repairability. It then takes the html and parses it to find three fields for each device: Manufacturer, Device Model, and Repairability Score. The data for these three fields is then written to one of three csv files (laptop.csv, smartphone.csv, and tablet.csv) based on the device type.
Once these files are stored, you can run Web_Dashboard/app.py, which starts a waitress server that serves webpages for each repairability score. The webpage templates are located in the Web_Dashboard/templates directory and the stylesheets are located in the Web_Dashboard/static directory. The webserver will be accessible at 0.0.0.0:1235.
## Live Demo
A live demo of this project is available at https://repairability.yeetpc.com
Note: this project is neither sponsored by nor affiliated with iFixit.
Loading…
Cancel
Save