-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first stable version of tracking page
- Loading branch information
Showing
9 changed files
with
323 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14549,7 +14549,7 @@ legend { | |
} | ||
|
||
.scroll-area-sm { | ||
height: 200px; | ||
height: 400px; | ||
overflow-x: hidden | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta http-equiv="Content-Language" content="en"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>FB Data Analysis Report</title> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" /> | ||
<meta name="description" content="Report containing information downloaded from your facebook account."> | ||
<meta name="msapplication-tap-highlight" content="no"> | ||
<!-- | ||
========================================================= | ||
* ArchitectUI HTML Theme Dashboard - v1.0.0 | ||
========================================================= | ||
* Product Page: https://dashboardpack.com | ||
* Copyright 2019 DashboardPack (https://dashboardpack.com) | ||
* Licensed under MIT (https://github.com/DashboardPack/architectui-html-theme-free/blob/master/LICENSE) | ||
========================================================= | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
--> | ||
<link href="./main.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<div class="app-container app-theme-white body-tabs-shadow fixed-sidebar fixed-header"> | ||
<div class="app-header header-shadow"> | ||
<div class="app-header__logo"> | ||
<div class="logo-src"></div> | ||
<div class="header__pane ml-auto"> | ||
</div> | ||
</div> | ||
<div class="app-header__mobile-menu"> | ||
<div> | ||
<button type="button" class="hamburger hamburger--elastic mobile-toggle-nav"> | ||
<span class="hamburger-box"> | ||
<span class="hamburger-inner"></span> | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="app-header__menu"> | ||
<span> | ||
<button type="button" | ||
class="btn-icon btn-icon-only btn btn-primary btn-sm mobile-toggle-header-nav"> | ||
<span class="btn-icon-wrapper"> | ||
<i class="fa fa-ellipsis-v fa-w-6"></i> | ||
</span> | ||
</button> | ||
</span> | ||
</div> | ||
<div class="app-header__content"> | ||
<div class="app-header-right"> | ||
<div class="widget-content-left"> | ||
<img width="60" class="rounded-circle" src="assets/images/user.jpg" alt=""> | ||
</div> | ||
<div class="widget-content-left ml-3 header-user-info"> | ||
<div class="widget-heading"> | ||
{user_name} | ||
</div> | ||
<div class="widget-subheading"> | ||
Member since {join_year} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="app-main"> | ||
<div class="app-sidebar sidebar-shadow"> | ||
<div class="app-header__logo"> | ||
<div class="logo-src"></div> | ||
<div class="header__pane ml-auto"> | ||
<div> | ||
<button type="button" class="hamburger close-sidebar-btn hamburger--elastic" | ||
data-class="closed-sidebar"> | ||
<span class="hamburger-box"> | ||
<span class="hamburger-inner"></span> | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="app-header__mobile-menu"> | ||
<div> | ||
<button type="button" class="hamburger hamburger--elastic mobile-toggle-nav"> | ||
<span class="hamburger-box"> | ||
<span class="hamburger-inner"></span> | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="app-header__menu"> | ||
<span> | ||
<button type="button" | ||
class="btn-icon btn-icon-only btn btn-primary btn-sm mobile-toggle-header-nav"> | ||
<span class="btn-icon-wrapper"> | ||
<i class="fa fa-ellipsis-v fa-w-6"></i> | ||
</span> | ||
</button> | ||
</span> | ||
</div> | ||
<div class="scrollbar-sidebar"> | ||
<div class="app-sidebar__inner"> | ||
<ul class="vertical-nav-menu"> | ||
<li class="app-sidebar__heading">Navigation</li> | ||
<li> | ||
<a href="index.html"> | ||
<i class="metismenu-icon pe-7s-user"></i> | ||
Main Dashboard | ||
</a> | ||
<li> | ||
<a href="location.html"> | ||
<i class="metismenu-icon pe-7s-world"> | ||
</i>Location | ||
</a> | ||
</li> | ||
<li> | ||
<a href="photos.html"> | ||
<i class="metismenu-icon pe-7s-camera"> | ||
</i>Photos | ||
</a> | ||
</li> | ||
<li> | ||
<a href="tracking.html" class="mm-active"> | ||
<i class="metismenu-icon pe-7s-target"> | ||
</i>Tracking | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="app-main__outer"> | ||
<div class="app-main__inner"> | ||
<div class="row"> | ||
<div class="col-md-12 col-lg-12"> | ||
<div class="main-card mb-3 card"> | ||
<div class="card-body"> | ||
<h5 class="card-title">Interests</h5> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-8 col-lg-8"> | ||
<canvas id="radar-chart"></canvas> | ||
</div> | ||
<div class="col-md-4 col-lg-4"> | ||
<h6 class="text-muted text-uppercase font-size-md opacity-5 font-weight-normal"> | ||
Interest list</h6> | ||
<div class="scroll-area-sm"> | ||
<div class="scrollbar-container"> | ||
<ul | ||
class="rm-list-borders rm-list-borders-scroll list-group list-group-flush"> | ||
{html_interests} | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-lg-6 col-xl-4"> | ||
<div class="card mb-3 widget-content bg-deep-blue"> | ||
<div class="widget-content-wrapper text-white"> | ||
<div class="widget-content-left"> | ||
<div class="widget-heading">Ads clicked</div> | ||
<div class="widget-subheading">Number of ads clicked on Facebook, some more than once.</div> | ||
</div> | ||
<div class="widget-content-right"> | ||
<div class="widget-numbers"><span>{nbr_of_ads_clicked}</span></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-lg-6 col-xl-4"> | ||
<div class="card mb-3 widget-content bg-deep-blue"> | ||
<div class="widget-content-wrapper text-white"> | ||
<div class="widget-content-left"> | ||
<div class="widget-heading">Websites selling your data to Facebook</div> | ||
<div class="widget-subheading">Number of websites selling data about you to Facebook</div> | ||
</div> | ||
<div class="widget-content-right"> | ||
<div class="widget-numbers"><span>{nbr_of_websites_tracking}</span></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-lg-6 col-xl-4"> | ||
<div class="card mb-3 widget-content bg-deep-blue"> | ||
<div class="widget-content-wrapper text-white"> | ||
<div class="widget-content-left"> | ||
<div class="widget-heading">Applications selling your data to Facebook</div> | ||
<div class="widget-subheading">Number of phone applications selling data about you to Facebook</div> | ||
</div> | ||
<div class="widget-content-right"> | ||
<div class="widget-numbers"><span>{nbr_of_applications_tracking}</span></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="./assets/scripts/main.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import utils | ||
from os import getcwd | ||
|
||
def parse_ad_interactions(user_data: dict) -> dict: | ||
""" Goes through your ad interaction data and parses the number of ad clicks """ | ||
ad_interactions_path = getcwd() + "/temp/ads_and_businesses/advertisers_you've_interacted_with.json" | ||
ad_interactions_list = utils.json_file_converter(ad_interactions_path)["history"] | ||
|
||
number_of_ads_clicked = len(ad_interactions_list) | ||
|
||
user_data["nbr_of_ads_clicked"] = utils.number_prettify(number_of_ads_clicked) | ||
|
||
return user_data | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import utils | ||
from os import getcwd | ||
|
||
def parse_interests(user_data: dict) -> dict: | ||
""" Goes through interests and parses number of interest per category """ | ||
interests_path = getcwd() + "/temp/ads_and_businesses/ads_interests.json" | ||
interest_categories_path = getcwd() + "/src/interests.json" | ||
|
||
user_interests = utils.json_file_converter(interests_path)["topics"] | ||
interest_categories = utils.json_file_converter(interest_categories_path) | ||
|
||
interest_category_count = {} | ||
interest_category_total = {} | ||
|
||
category_list = list(interest_categories.keys()) | ||
|
||
for category in category_list: | ||
interest_category_count[category] = 0 | ||
interest_category_total[category] = 0 | ||
|
||
for category in category_list: | ||
for interest in interest_categories[category]: | ||
interest_category_total[category] += 1 | ||
if interest in user_interests: | ||
interest_category_count[category] += 1 | ||
|
||
# standardise results by dividing by total number of interests per category | ||
for category in category_list: | ||
interest_category_count[category] = int((interest_category_count[category] / interest_category_total[category]) * 100) | ||
|
||
# transform to list | ||
interest_count_list = list(interest_category_count.values()) | ||
|
||
print("interest_category_count: ", interest_category_count) | ||
|
||
# build a html interest string for the side list of interests | ||
html_interests = html_interest_list_builder(user_interests, interest_categories) | ||
|
||
user_data["interest_categories"] = category_list | ||
user_data["interest_count"] = interest_count_list | ||
user_data["html_interests"] = html_interests | ||
|
||
return user_data | ||
|
||
def html_interest_list_builder(user_interests: list, interest_categories: dict) -> str: | ||
""" Takes a list of user interests and the interest categories dict, and produces a string in HTML format of user interests """ | ||
start_html = """<li class="list-group-item"><div class="widget-content p-0"><div class="widget-content-wrapper"><div class="widget-content-left"><div class="widget-heading">""" | ||
mid_html = """</div><div class="widget-subheading">""" | ||
end_html = """</div></div></div></div></li>""" | ||
|
||
html_interests = "" | ||
|
||
for interest in user_interests: | ||
html_interests += start_html + interest + mid_html + "other" + end_html | ||
|
||
return html_interests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import utils | ||
from os import getcwd | ||
|
||
def parse_off_facebook_activities(user_data: dict) -> dict: | ||
""" Goes through off_facebook_activities and parses number of websites and applications that hand over your data to Facebook """ | ||
off_facebook_activities_path = getcwd() + "/temp/ads_and_businesses/your_off-facebook_activity.json" | ||
off_facebook_activity_list = utils.json_file_converter(off_facebook_activities_path)["off_facebook_activity"] | ||
|
||
number_of_websites_tracking_the_user = 0 | ||
number_of_applications_tracking_the_user = 0 | ||
|
||
for tracking_entity in off_facebook_activity_list: | ||
if "." in tracking_entity["name"]: # if there's a full stop, assume it's a website and not an application | ||
number_of_websites_tracking_the_user += 1 | ||
else: | ||
number_of_applications_tracking_the_user += 1 | ||
|
||
user_data["nbr_of_websites_tracking"] = utils.number_prettify(number_of_websites_tracking_the_user) | ||
user_data["nbr_of_applications_tracking"] = utils.number_prettify(number_of_applications_tracking_the_user) | ||
|
||
return user_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters