Skip to content

Commit

Permalink
Updating inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelle De Laender authored and Jelle De Laender committed Jun 30, 2021
1 parent 2b3f8d0 commit d1c3360
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OUAppStoreRankings

Open University - The Netherlands

Software to support for MSc Software Engineer thesis, "Do iOS applications respect your privacy? A case study on popular iPhone apps in Belgium."

## Intro
Expand Down
12 changes: 11 additions & 1 deletion appinfo.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# AppInfo.rb
#
# Objective of AppInfo.rb is to give a visualisation of all known data ofa given application.
# This script can be called with the AppID as parameter, and optional the path of the database.
# The script will then print all enters, ranking and more which can be used for debugging or analysing entries.
#
# Usage
# ruby toplist.rb <appid> <optional:DB Location>
#
#

require "sqlite3"
load "lib/pretty_table.rb"

def main
db_location = "OURanking.sqlite"
Expand Down
13 changes: 1 addition & 12 deletions apps.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
/*
Navicat Premium Data Transfer
Source Server : OURanking
Source Server Type : SQLite
Source Server Version : 3012001
Source Database : main
Target Server Type : SQLite
Target Server Version : 3012001
File Encoding : utf-8
Date: 07/31/2020 00:41:47 AM
Export of internaldatabase structure used by OUAppStoreRankings
*/

PRAGMA foreign_keys = false;
Expand Down
3 changes: 0 additions & 3 deletions lib/dataprocessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ def process_array_with_apps(list, device)
end

def process_app(app, category, device)

#puts "App: #{app}"

db_structure = [
@date.to_s,
app["app_id"],
Expand Down
1 change: 1 addition & 0 deletions lib/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


class Downloader
## Currently using SensorTower public API as dataset.

def self.download url
uri = URI.parse(url)
Expand Down
6 changes: 4 additions & 2 deletions lib/pretty_table.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

## PrettyTable, based on https://stackoverflow.com/questions/28684598/print-an-array-into-a-table-in-ruby
## With smalll aditions and improvements
# PrettyTable, based on https://stackoverflow.com/questions/28684598/print-an-array-into-a-table-in-ruby
# With smalll aditions and improvements
#

class PrettyTable

@labels
Expand Down
12 changes: 12 additions & 0 deletions rankings.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Rankings.rb
#
# Objective of rankings.rb is to update the local database by downloading and processing the latest top list of the AppStore
# Via a parameter,the number of last days to be processed can be indicated.
# Optionally, it is possible to clear the database and to use a database on a different path.
# The database must exist and have the correct structure as defined in apps.sql
#
# Usage
# ruby rankings.rb <number_of_days> <optional: Clear database {true/false}> <optional: DB Location>
#
#

require 'date'
load "lib/dataprocessor.rb"
require "sqlite3"
Expand Down
16 changes: 14 additions & 2 deletions toplist.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# TopList.rb
#
# Objective of toplist.rb is to generate top lists for the given database. Default the database location 'OURanking.sqlite' and a limit of 50.
# Via parameters, the top list can be generated for free, paid or grossing applications and for iPhone,iPad or both app types.
# It's also possible to process a different database by entering the path of the database as fourth parameter.
#
# Usage
# ruby toplist.rb <free/paid/grossing> <iphone/ipad/all> <optional:limit> <optional:DB Location>
#
#


require "sqlite3"
load "lib/pretty_table.rb"

def main
db_location = "OURanking.sqlite"
limit = 50

## Loading data from arguments
## Loading and processing arguments
arg_length = ARGV.length
if arg_length < 2 || arg_length > 4
puts "Incorrect usage."
Expand Down Expand Up @@ -34,7 +46,7 @@ def main
## Alternative DB_Location
db_location = ARGV[3] if arg_length > 3

## Generate toplist
## Generate toplist for current context
db = SQLite3::Database.new db_location
db.results_as_hash = true

Expand Down

0 comments on commit d1c3360

Please sign in to comment.