- The problem statement, all variables and given/known data:
Develop a shell script that accepts a phrase and counts the number of times that it is repeated in a specific website.
Note: Im not sure if it's the whole website, or just a specific page but im guessing its thewhole website.
-
Relevant commands, code, scripts, algorithms:
wget, curl, grep -
The attempts at a solution (include all code and scripts):
(for now i just did the home page)
#!/bin/bash
echo "Enter a phrase:"
read phrase
echo "Number of occurences is:"
curl --websiteHere-- | grep "$phrase" | wc -l
Other Ideas:
-wget the whole humber.ca website (so it downloads every page into a .html file) and then grepping that file for the specific phrase.
-downside: this takes way too long (downloading the whole website)
-curling the humber.ca search with the phrase in it (not exactly sure how to do this all in a shell script) so it brings up the pages with the specific phrase for the site and then just grepping and word counting those pages.
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Humber College (North Campus), Toronto, Canada, Alireza M. , 160950: Game 130
Thanks