Removes tracking completely
This commit is contained in:
parent
3afba6f3eb
commit
6abaa46c8f
|
@ -60,7 +60,6 @@ HackerTray accepts its various options via the command line. Run `hackertray -h`
|
||||||
1. `-c`: Enables comments support. Clicking on links will also open the comments page on HN. Can be switched off via the UI, but the setting is not remembered.
|
1. `-c`: Enables comments support. Clicking on links will also open the comments page on HN. Can be switched off via the UI, but the setting is not remembered.
|
||||||
2. `--chrome PROFILE-PATH`: Specifying a profile path to a chrome directory will make HackerTray read the Chrome History file to mark links as read. Links are checked once every 5 minutes, which is when the History file is copied (to override the lock in case Chrome is open), searched using sqlite and deleted. This feature is still experimental.
|
2. `--chrome PROFILE-PATH`: Specifying a profile path to a chrome directory will make HackerTray read the Chrome History file to mark links as read. Links are checked once every 5 minutes, which is when the History file is copied (to override the lock in case Chrome is open), searched using sqlite and deleted. This feature is still experimental.
|
||||||
3. `--firefox PROFILE-PATH`: Specify path to a firefox profile directory. HackerTray will read your firefox history from this profile, and use it to mark links as read.
|
3. `--firefox PROFILE-PATH`: Specify path to a firefox profile directory. HackerTray will read your firefox history from this profile, and use it to mark links as read.
|
||||||
4. `--dnt`: Disable analytics. Hackertray will no longer collect any sort of analytics. I'd prefer it if you left out this switch, as it helps me improve hackertray by understanding how its being used.
|
|
||||||
|
|
||||||
Note that the `--chrome` and `--firefox` options are independent, and can be used together. However, they cannot be specified multiple times (so reading from 2 chrome profiles is not possible).
|
Note that the `--chrome` and `--firefox` options are independent, and can be used together. However, they cannot be specified multiple times (so reading from 2 chrome profiles is not possible).
|
||||||
|
|
||||||
|
@ -103,7 +102,7 @@ To develop on hackertray, or to test out experimental versions, do the following
|
||||||
|
|
||||||
## Analytics
|
## Analytics
|
||||||
|
|
||||||
To help improve the project and learn how its being used, I've added Analytics in hackertray. The `--dnt` switch disables all analytics so that you can opt-out if desired. All data is collected anonymously, with no machine id or user-identifying information being sent back. To learn more, and see which events are being tracked, see the [Analytics](https://github.com/captn3m0/hackertray/wiki/Analytics) wiki page.
|
**No more tracking**. All data every collected for this project has been deleted. You can see [the wiki](https://github.com/captn3m0/hackertray/wiki/Analytics) for what all was collected earlier.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,12 @@ from .hackernews import HackerNews
|
||||||
from .chrome import Chrome
|
from .chrome import Chrome
|
||||||
from .firefox import Firefox
|
from .firefox import Firefox
|
||||||
from .version import Version
|
from .version import Version
|
||||||
from .analytics import Analytics
|
|
||||||
|
|
||||||
|
|
||||||
class HackerNewsApp:
|
class HackerNewsApp:
|
||||||
HN_URL_PREFIX = "https://news.ycombinator.com/item?id="
|
HN_URL_PREFIX = "https://news.ycombinator.com/item?id="
|
||||||
UPDATE_URL = "https://github.com/captn3m0/hackertray#upgrade"
|
UPDATE_URL = "https://github.com/captn3m0/hackertray#upgrade"
|
||||||
ABOUT_URL = "https://github.com/captn3m0/hackertray"
|
ABOUT_URL = "https://github.com/captn3m0/hackertray"
|
||||||
MIXPANEL_TOKEN = "51a04e37dad59393c7371407e84a8050"
|
|
||||||
|
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
# Load the database
|
# Load the database
|
||||||
|
@ -49,9 +47,6 @@ class HackerNewsApp:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.db = set()
|
self.db = set()
|
||||||
|
|
||||||
# Setup analytics
|
|
||||||
self.tracker = Analytics(args.dnt, HackerNewsApp.MIXPANEL_TOKEN)
|
|
||||||
|
|
||||||
# create an indicator applet
|
# create an indicator applet
|
||||||
self.ind = appindicator.Indicator("Hacker Tray", "hacker-tray", appindicator.CATEGORY_APPLICATION_STATUS)
|
self.ind = appindicator.Indicator("Hacker Tray", "hacker-tray", appindicator.CATEGORY_APPLICATION_STATUS)
|
||||||
self.ind.set_status(appindicator.STATUS_ACTIVE)
|
self.ind.set_status(appindicator.STATUS_ACTIVE)
|
||||||
|
@ -111,7 +106,7 @@ class HackerNewsApp:
|
||||||
launch_data['browser'] = subprocess.check_output(["xdg-settings", "get", "default-web-browser"]).strip()
|
launch_data['browser'] = subprocess.check_output(["xdg-settings", "get", "default-web-browser"]).strip()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
launch_data['browser'] = "unknown"
|
launch_data['browser'] = "unknown"
|
||||||
self.tracker.track('launch', launch_data)
|
|
||||||
|
|
||||||
def toggleComments(self, widget):
|
def toggleComments(self, widget):
|
||||||
"""Whether comments page is opened or not"""
|
"""Whether comments page is opened or not"""
|
||||||
|
@ -122,12 +117,10 @@ class HackerNewsApp:
|
||||||
webbrowser.open(HackerNewsApp.UPDATE_URL)
|
webbrowser.open(HackerNewsApp.UPDATE_URL)
|
||||||
# Remove the update button once clicked
|
# Remove the update button once clicked
|
||||||
self.menu.remove(widget)
|
self.menu.remove(widget)
|
||||||
self.tracker.visit(HackerNewsApp.UPDATE_URL)
|
|
||||||
|
|
||||||
def showAbout(self, widget):
|
def showAbout(self, widget):
|
||||||
"""Handle the about btn"""
|
"""Handle the about btn"""
|
||||||
webbrowser.open(HackerNewsApp.ABOUT_URL)
|
webbrowser.open(HackerNewsApp.ABOUT_URL)
|
||||||
self.tracker.visit(HackerNewsApp.ABOUT_URL)
|
|
||||||
|
|
||||||
# ToDo: Handle keyboard interrupt properly
|
# ToDo: Handle keyboard interrupt properly
|
||||||
def quit(self, widget, data=None):
|
def quit(self, widget, data=None):
|
||||||
|
@ -140,7 +133,6 @@ class HackerNewsApp:
|
||||||
file.write(json.dumps(l))
|
file.write(json.dumps(l))
|
||||||
|
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
self.tracker.track('quit')
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
signal.signal(signal.SIGINT, self.quit)
|
signal.signal(signal.SIGINT, self.quit)
|
||||||
|
@ -161,7 +153,6 @@ class HackerNewsApp:
|
||||||
|
|
||||||
if self.commentState:
|
if self.commentState:
|
||||||
webbrowser.open(self.HN_URL_PREFIX + str(widget.hn_id))
|
webbrowser.open(self.HN_URL_PREFIX + str(widget.hn_id))
|
||||||
self.tracker.visit(widget.url)
|
|
||||||
|
|
||||||
def addItem(self, item):
|
def addItem(self, item):
|
||||||
"""Adds an item to the menu"""
|
"""Adds an item to the menu"""
|
||||||
|
@ -230,7 +221,6 @@ def main():
|
||||||
parser.add_argument('-c', '--comments', dest='comments', action='store_true', help="Load the HN comments link for the article as well")
|
parser.add_argument('-c', '--comments', dest='comments', action='store_true', help="Load the HN comments link for the article as well")
|
||||||
parser.add_argument('--chrome', dest='chrome', help="Specify a Google Chrome Profile directory to use for matching chrome history")
|
parser.add_argument('--chrome', dest='chrome', help="Specify a Google Chrome Profile directory to use for matching chrome history")
|
||||||
parser.add_argument('--firefox', dest='firefox', help="Specify a Firefox Profile directory to use for matching firefox history")
|
parser.add_argument('--firefox', dest='firefox', help="Specify a Firefox Profile directory to use for matching firefox history")
|
||||||
parser.add_argument('--dnt', dest='dnt', action='store_true', help="Disable all analytics (Do Not Track)")
|
|
||||||
parser.set_defaults(comments=False)
|
parser.set_defaults(comments=False)
|
||||||
parser.set_defaults(dnt=False)
|
parser.set_defaults(dnt=False)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
from mixpanel import Mixpanel
|
|
||||||
|
|
||||||
|
|
||||||
class Analytics:
|
|
||||||
# Setup analytics.
|
|
||||||
# dnt - do not track. Disables tracking if True
|
|
||||||
# token - The mixpanel token
|
|
||||||
|
|
||||||
def __init__(self, dnt, token):
|
|
||||||
self.dnt = dnt
|
|
||||||
self.tracker = Mixpanel(token)
|
|
||||||
if(self.dnt == True):
|
|
||||||
print("[+] Analytics disabled")
|
|
||||||
# Track an event
|
|
||||||
# event - string containing the event name
|
|
||||||
# data - data related to the event, defaults to {}
|
|
||||||
|
|
||||||
def track(self, event, data={}):
|
|
||||||
if(self.dnt == False):
|
|
||||||
# All events are tracked anonymously
|
|
||||||
self.tracker.track("anonymous", event, data)
|
|
||||||
# Track a visit to a URL
|
|
||||||
# The url maybe an HN submission or
|
|
||||||
# some meta-url pertaining to hackertray
|
|
||||||
|
|
||||||
def visit(self, url):
|
|
||||||
self.track('visit', {"link": url})
|
|
6
setup.py
6
setup.py
|
@ -3,10 +3,7 @@ import sys
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools import find_packages
|
from setuptools import find_packages
|
||||||
|
|
||||||
|
|
||||||
requirements = ['requests']
|
requirements = ['requests']
|
||||||
if sys.version_info < (2, 7):
|
|
||||||
requirements.append('argparse')
|
|
||||||
|
|
||||||
setup(name='hackertray',
|
setup(name='hackertray',
|
||||||
version='3.0.0',
|
version='3.0.0',
|
||||||
|
@ -22,8 +19,7 @@ setup(name='hackertray',
|
||||||
'hackertray.data': ['hacker-tray.png']
|
'hackertray.data': ['hacker-tray.png']
|
||||||
},
|
},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'requests>=2.2.1',
|
'requests>=2.23.0'
|
||||||
'mixpanel-py>=3.0.0'
|
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': ['hackertray = hackertray:main'],
|
'console_scripts': ['hackertray = hackertray:main'],
|
||||||
|
|
Loading…
Reference in New Issue