Skip to content

Commit

Permalink
v1.2.0: Dataset update, cleanup + What's New popup
Browse files Browse the repository at this point in the history
  • Loading branch information
basharovV committed Dec 23, 2021
1 parent 38c3857 commit 928b28e
Show file tree
Hide file tree
Showing 1,597 changed files with 43,804 additions and 120,087 deletions.
21 changes: 18 additions & 3 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ const getLastWindowId = async () => {
}

function update() {
chrome.storage.local.get(['visited', 'totalUrls', 'welcome_seen'], function (result) {
chrome.storage.local.get(['visited', 'totalUrls', 'welcome_seen', 'show_update'], function (result) {

if (result.welcome_seen === undefined || result.welcome_seen === false || result.welcome_seen === null) {
chrome.tabs.executeScript({
Expand All @@ -348,9 +348,11 @@ function update() {
chrome.tabs.executeScript({
file: 'content.js'
}, function () {
notifyTabWelcome();
notifyTabWelcome();
});
});
} else if (result.show_update) {
notifyTabUpdate();
} else {
const count = result.visited === undefined ? 0 : parseInt(result.visited)
const incremented = count + 1;
Expand Down Expand Up @@ -384,6 +386,14 @@ function notifyTabWelcome() {
});
}

function notifyTabUpdate() {
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
var activeTab = tabs[0];
chrome.tabs.sendMessage(stumbleTabId, { "message": "update" });
chrome.storage.local.set('show_update', false);
});
}

// Load a page on click
chrome.browserAction.onClicked.addListener(
async function (tab) {
Expand Down Expand Up @@ -420,9 +430,14 @@ function clearCounter() {
chrome.storage.local.remove(['visited'])
}

chrome.runtime.onInstalled.addListener(function () {
chrome.runtime.onInstalled.addListener(function (details) {
// For development purposes only, uncomment when needed
// chrome.storage.local.remove(['visited', 'welcome_seen', 'totalUrls'])

// Check for update
if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) {
chrome.storage.local.set('show_update', true);
}

chrome.contextMenus.removeAll(function () {
chrome.contextMenus.create({
Expand Down
73 changes: 56 additions & 17 deletions extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,63 +260,100 @@ function toggleStumbleInfo(request) {
}
}

function hideWelcomeInfo() {
document.body.removeChild(document.getElementById('sax-welcome'))
function hideInfo() {
document.body.removeChild(document.getElementById('sax-info'))
}

function showWelcomeInfo(request) {
os = request.os;

const ui = document.createElement('div');
ui.id = "sax-welcome";
ui.id = "sax-info";
icon = document.createElement('img');

icon.id = 'sax-welcome-icon';
icon.id = 'sax-info-icon';
icon.src = chrome.extension.getURL('images/icon_128.png');

text = div('sax-welcome-text');
text.innerHTML = `<p id="sax-welcome-text-title">
text = div('sax-info-text');
text.innerHTML = `<p id="sax-info-text-title">
You stumbled on your first site!
</p>
</br>
<p id="sax-welcome-text-body">
<p id="sax-info-text-body">
This extension gives you endless hours of developer-friendly internet discovery.
</br>
Stumble by clicking on the ⚡️ icon in the toolbar, or press <span id="sax-keyboard-shortcut">${os === 'mac' ? "Alt+Shift+S" : "Alt+Shift+S"}
</span>
</br></br>
<div id="sax-welcome-new-feature">
<div id="sax-info-new-feature">
<img id="sax-rabbit-hole-spiral-2" src=${chrome.extension.getURL('images/spiral.png')} />
<span id='sax-welcome-text-body-small-accent'>NEW!</span>
<span id='sax-info-text-body-small-accent'>NEW!</span>
</br>
<span id='sax-welcome-text-body-small'>
<span id='sax-welcome-text-body-small-white'>Rabbit hole: </span>You can now stay stumblin' on the same topic. On your next stumble, follow the rabbit...
<span id='sax-info-text-body-small'>
<span id='sax-info-text-body-small-white'>Rabbit hole: </span>You can now stay stumblin' on the same topic. On your next stumble, follow the rabbit...
</span>
<img id="sax-rabbit-hole-image-2" src=${chrome.extension.getURL('images/rabbithole_small.png')} />
</div>
</br></br>
<p id="sax-welcome-text-body-smaller-white">
💬 I'll improve this extension with <a id="sax-welcome-text-body-feedback-link" href="mailto:[email protected]">your feedback</a>
<p id="sax-info-text-body-smaller-white">
💬 I'll improve this extension with <a id="sax-info-text-body-feedback-link" href="mailto:[email protected]">your feedback</a>
</p>
<p id="sax-welcome-text-opensource">
<p id="sax-info-text-opensource">
ℹ Also, this extension is open-source!
<a id="sax-welcome-text-opensource-link" href="https://github.com/basharovV/StumbleUponAwesome">
<a id="sax-info-text-opensource-link" href="https://github.com/basharovV/StumbleUponAwesome">
See the code and URLs
</a></p>`;

close = document.createElement('a')
close.innerHTML = "Awesome, got it! 🤘"
close.id = 'sax-welcome-close';
close.id = 'sax-info-close';

ui.appendChild(icon);
ui.appendChild(text);
ui.appendChild(close);
close.addEventListener('click', hideWelcomeInfo);
close.addEventListener('click', hideInfo);
document.body.prepend(ui);
chrome.storage.local.set({ 'welcome_seen': true }, function () {
});
}

function showUpdateInfo() {

const ui = document.createElement('div');
ui.id = "sax-info";
icon = document.createElement('img');

icon.id = 'sax-info-icon';
icon.src = chrome.extension.getURL('images/icon_128.png');

text = div('sax-info-text');
text.innerHTML = `<p id="sax-info-text-title">StumbleUponAwesome updated to 1.2.0!
</p>
</br>
<p id="sax-info-text-body">
In this update:
</p>
<p id="sax-info-text-body-smaller-white">
- Added 2,328 new URLs and 12 new topics including Theoretical Computer Science, Neovim, Youtubers, Robotic Tooling, WebXR, Veganism and more!
</br>
- Cleanup of broken and outdated URLs.
</p>
</br>`;

close = document.createElement('a');
close.innerHTML = "Awesome, got it! 🤘";
close.id = 'sax-info-close';

ui.appendChild(icon);
ui.appendChild(text);
ui.appendChild(close);
close.addEventListener('click', hideInfo);
document.body.prepend(ui);
chrome.storage.local.set({ 'show_update': false }, function () {
});
}

chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
if (request.message === "stumble") {
Expand All @@ -331,6 +368,8 @@ chrome.runtime.onMessage.addListener(
}
} else if (request.message === "welcome") {
showWelcomeInfo(request);
} else if (request.message === "update") {
showUpdateInfo(request);
}
}
);
6 changes: 5 additions & 1 deletion extension/data/broken-urls/awesome/.NET.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
https://gistlyn.com/,Gistlyn,https://github.com/quozd/awesome-dotnet#readme,.NET error: URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
https://fsharp.github.io/FSharp.Data/,F# Data,https://github.com/quozd/awesome-dotnet#readme,.NET error: <HTTPError 404: 'Not Found'> | reason: Not Found
http://www.n-fluent.net,NFluent,https://github.com/quozd/awesome-dotnet#readme,.NET error: timeout('timed out') | reason:
https://xbehave.github.io,https://xbehave.github.io,https://github.com/quozd/awesome-dotnet#readme,.NET error: <HTTPError 404: 'Not Found'> | reason: Not Found
http://www.bettercms.com,BetterCMS,https://github.com/quozd/awesome-dotnet#readme,.NET error: <HTTPError 403: 'Site Disabled'> | reason: Site Disabled
http://www.emgu.com/wiki/index.php/Main_Page,Emgu CV,https://github.com/quozd/awesome-dotnet#readme,.NET error: URLError('no host given') | reason: no host given
1 change: 1 addition & 0 deletions extension/data/broken-urls/awesome/AI in Finance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://www.quantopian.com/posts/watch-our-webinar-buying-happiness-using-lstms-to-turn-feelings-into-trades-now?utm_source=forum&utm_medium=twitter&utm_campaign=sentiment-analysis,Using LSTMs to Turn Feelings Into Trades,https://github.com/georgezouq/awesome-ai-in-finance#readme,AI in Finance error: <HTTPError 530: ''> | reason:
6 changes: 4 additions & 2 deletions extension/data/broken-urls/awesome/AMA.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
http://watchmecode.com,screencaster,https://github.com/sindresorhus/amas#readme,AMA error: URLError(ConnectionRefusedError(61, 'Connection refused')) | reason: [Errno 61] Connection refused
http://anthonyramella.com,blog,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
http://codemonkeyhealth.com,LEAF,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://M-ZUBER/AMA,Mordechai Zuber,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://nodecasts.io,Nodecasts,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
http://reactive.audio,Reactive Podcast,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://www.mashape.com,Mashape,https://github.com/sindresorhus/amas#readme,AMA error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
http://watchmecode.com,screencaster,https://github.com/sindresorhus/amas#readme,AMA error: <HTTPError 503: 'Service Unavailable'> | reason: Service Unavailable
https://www.airbnb.com,Airbnb,https://github.com/sindresorhus/amas#readme,AMA error: <HTTPError 403: 'Forbidden'> | reason: Forbidden
3 changes: 1 addition & 2 deletions extension/data/broken-urls/awesome/AVA.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
https://spectrum.chat/ava,Spectrum,https://github.com/avajs/awesome-ava#readme,AVA error: <HTTPError 503: 'Service Unavailable'> | reason: Service Unavailable
http://avacasts.com,AVA Casts,https://github.com/avajs/awesome-ava#readme,AVA error: <HTTPError 404: 'Not Found'> | reason: Not Found
http://silvenon.com/testing-react-and-redux/,Testing a React & Redux Codebase,https://github.com/avajs/awesome-ava#readme,AVA error: <HTTPError 308: 'Permanent Redirect'> | reason: Permanent Redirect
4 changes: 2 additions & 2 deletions extension/data/broken-urls/awesome/ActionScript 3.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
http://www.isohill.com/,website,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
http://www.flasheffnano.com/,FlashEffNano,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://greensock.com/TransformManager,TransformManager,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: <HTTPError 404: 'Not Found'> | reason: Not Found
https://greensock.com/gsap-as,GreenSock GSAP,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: <HTTPError 404: 'Not Found'> | reason: Not Found
http://moonshine-ide.com/,Moonshine IDE,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
https://greensock.com/gsap-as,GreenSock GSAP,https://github.com/robinrodricks/awesome-actionscript3#readme,ActionScript 3 error: <HTTPError 404: 'Not Found'> | reason: Not Found
3 changes: 1 addition & 2 deletions extension/data/broken-urls/awesome/Actions on Google.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
https://developers.google.com/actions/transactions/digital/dev-guide-digital,Build digital transactions,https://github.com/ravirupareliya/awesome-actions-on-google#readme,Actions on Google error: <HTTPError 404: 'Not Found'> | reason: Not Found
https://www.androidauthority.com/author/jessicathornsby/,Jessica Thornsy,https://github.com/ravirupareliya/awesome-actions-on-google#readme,Actions on Google error: timeout('The read operation timed out') | reason:
https://developers.google.com/actions/transactions/digital/dev-guide-digital,Build digital transactions,https://github.com/ravirupareliya/awesome-actions-on-google#readme,Actions on Google error: <HTTPError 404: 'Not Found'> | reason: Not Found
5 changes: 4 additions & 1 deletion extension/data/broken-urls/awesome/Ad-Free.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
https://gnusocial.no,GNUsocial.no,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: URLError(ConnectionRefusedError(61, 'Connection refused')) | reason: [Errno 61] Connection refused
https://readytheapp.com/,Ready,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://nomoreads.org,No More Ads,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://libre.fm/,Libre.fm,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: <HTTPError 500: 'Internal Server Error'> | reason: Internal Server Error
https://www.armstrongeconomics.com/uncategorized/no-advertising/,Armstrong Economics,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: <HTTPError 503: 'Service Temporarily Unavailable'> | reason: Service Temporarily Unavailable
https://wire.com/en/privacy/,Wire,https://github.com/johnjago/awesome-ad-free#readme,Ad-Free error: <HTTPError 404: 'Not Found'> | reason: Not Found
4 changes: 3 additions & 1 deletion extension/data/broken-urls/awesome/Advertising.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
https://support.smartadserver.com/s/article/Holistic-Setup,Smart Ad Server + Prebid.js,https://github.com/cenoura/awesome-ads#readme,Advertising error: URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
http://react-dfp.ml/,Docs,https://github.com/cenoura/awesome-ads#readme,Advertising error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://support.smartadserver.com/s/article/Holistic-Setup,Smart Ad Server + Prebid.js,https://github.com/cenoura/awesome-ads#readme,Advertising error: URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
https://academy.exceedlms.com/student/catalog/list?category_ids=682-programmatic,Google Ads Academy: Programmatic,https://github.com/cenoura/awesome-ads#readme,Advertising error: <HTTPError 404: 'Not Found'> | reason: Not Found
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
http://research.neustar.biz/2012/10/25/sketch-of-the-day-hyperloglog-cornerstone-of-a-big-data-infrastructure/,HyperLogLog for big data distinct values,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: <HTTPError 403: 'Forbidden'> | reason: Forbidden
https://probmods.org/chapters/02-generative-models.html,,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: <HTTPError 404: 'Not Found'> | reason: Not Found
http://beta.mathigon.org/,beta site,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://www.khanacademy.org/computing/computer-science/algorithms/breadth-first-search/a/the-breadth-first-search-algorithm,Breadth First Search,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: timeout('The read operation timed out') | reason:
https://www.khanacademy.org/computing/computer-science/algorithms,Khan Academy algorithms course,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: timeout('The read operation timed out') | reason:
https://briangordon.github.io/2014/08/the-skyline-problem.html,The Skyline Problem,https://github.com/enjalot/algovis#readme,Algorithm Visualizations error: <HTTPError 404: 'Not Found'> | reason: Not Found
8 changes: 3 additions & 5 deletions extension/data/broken-urls/awesome/Algorithms.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
https://a2oj.com/,A2 Online Judge,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1076)')) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1076)
http://shop.waynewbishop.com/,Swift Algorithms & Data Structures,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
https://www.manning.com/livevideo/algorithms-in-motion,Algorithms in Motion,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: <HTTPError 500: ''> | reason:
http://www.algomuse.appspot.com,Algo Muse,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.algomuse.appspot.com'. (_ssl.c:1076)")) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.algomuse.appspot.com'. (_ssl.c:1076)
http://www.stoimen.com/,Stoimen's web log,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(gaierror(8, 'nodename nor servname provided, or not known')) | reason: [Errno 8] nodename nor servname provided, or not known
http://judge.lavida.us,LavidaOnlineJudge,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: <HTTPError 504: 'Gateway Time-out'> | reason: Gateway Time-out
http://judge.lavida.us,LavidaOnlineJudge,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'judge.lavida.us'. (_ssl.c:1123)")) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'judge.lavida.us'. (_ssl.c:1123)
https://icpcarchive.ecs.baylor.edu/,ACM-ICPC Live Archive,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'icpcarchive.ecs.baylor.edu'. (_ssl.c:1123)")) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'icpcarchive.ecs.baylor.edu'. (_ssl.c:1123)
http://www.algomuse.appspot.com,Algo Muse,https://github.com/tayllan/awesome-algorithms#readme,Algorithms error: URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.algomuse.appspot.com'. (_ssl.c:1123)")) | reason: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.algomuse.appspot.com'. (_ssl.c:1123)
Loading

0 comments on commit 928b28e

Please sign in to comment.