diff --git a/.DS_Store b/.DS_Store index a5ba00e..6f464c9 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Project Progress Report.pdf b/Project Progress Report.pdf new file mode 100644 index 0000000..73475a2 Binary files /dev/null and b/Project Progress Report.pdf differ diff --git a/background.js b/background.js index 1943cab..2c81015 100644 --- a/background.js +++ b/background.js @@ -1,5 +1,5 @@ -chrome.runtime.onInstalled.addListener(function() { - console.log("Extension installed"); - // Perform on install actions, e.g., setting up default values in storage - chrome.tabs.create({ url: 'http://google.com' }); - }); +// chrome.runtime.onInstalled.addListener(function() { +// console.log("Extension installed"); +// // Perform on install actions, e.g., setting up default values in storage +// chrome.tabs.create({ url: 'http://google.com' }); +// }); diff --git a/content.js b/content.js index 4fe1370..d971b75 100644 --- a/content.js +++ b/content.js @@ -1,36 +1,19 @@ // content.js -// This script will change the background color of the Google homepage to lightblue +chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { + if (request.action === "fetchData") { + var courseInfoDiv = document.getElementById('app-course-info'); + if (courseInfoDiv) { + var courseTitle = courseInfoDiv.querySelector('.app-text-engage').textContent; + var courseDescription = courseInfoDiv.querySelectorAll('.col-sm-12')[1].textContent.trim(); -// Check if the current page is Google's homepage -if (window.location.hostname === 'www.google.com' && window.location.pathname === '/') { - // Change the background color to lightblue - document.body.style.backgroundColor = 'lightblue'; - - // Add a custom message to the page - const messageDiv = document.createElement('div'); - messageDiv.textContent = 'This is a message from your Chrome Extension!'; - messageDiv.style.position = 'fixed'; - messageDiv.style.bottom = '10px'; - messageDiv.style.right = '10px'; - messageDiv.style.padding = '10px'; - messageDiv.style.backgroundColor = '#fff'; - messageDiv.style.border = '1px solid #ddd'; - messageDiv.style.borderRadius = '4px'; - messageDiv.style.boxShadow = '0 2px 4px rgba(0,0,0,0.2)'; - document.body.appendChild(messageDiv); - } - - // Listen for messages from the background script or popup - chrome.runtime.onMessage.addListener( - function(request, sender, sendResponse) { - if (request.greeting === "hello") { - console.log("Hello from the background script!"); - // Perform actions based on the message - sendResponse({farewell: "goodbye"}); + // Remove sentences that start with "Credit" or "Prerequisite" + courseDescription = courseDescription.replace(/Credit.*?(\.|\?|!)(?=\s|$)/g, ''); + courseDescription = courseDescription.replace(/Prerequisite.*?(\.|\?|!)(?=\s|$)/g, ''); + + sendResponse({ + courseTitle: courseTitle, + courseDescription: courseDescription.trim() + }); } - } - ); - - // This is just an example and won't necessarily do anything meaningful - // unless it's part of a larger extension that you've configured to work with Google's homepage. - \ No newline at end of file + } +}); diff --git a/course_explorer.py b/course_explorer.py index ddf7a3c..a2be59d 100644 --- a/course_explorer.py +++ b/course_explorer.py @@ -115,3 +115,4 @@ def is_valid_wikipedia_page(title, lang='en'): print("Keywords (SpaCy):", keywords_spacy) print("Wikipedia Links:", wikipedia_links) print("Wikipedia Links (SpaCy):", wikipedia_links_spacy) + diff --git a/manifest.json b/manifest.json index b274798..195843e 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ }, "content_scripts": [ { - "matches": ["http://*/*", "https://*/*"], + "matches": ["https://courses.illinois.edu/schedule/*"], "js": ["content.js"] } ] diff --git a/popup.html b/popup.html index 5f9b98e..d0970b8 100644 --- a/popup.html +++ b/popup.html @@ -1,29 +1,19 @@
-