]> git.armaanb.net Git - phrases.git/commitdiff
first push
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Tue, 1 Dec 2020 00:07:37 +0000 (19:07 -0500)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Tue, 1 Dec 2020 00:07:37 +0000 (19:07 -0500)
.gitignore [new file with mode: 0644]
LICENSE [new file with mode: 0644]
Makefile [new file with mode: 0644]
README.md [new file with mode: 0644]
extract.py [new file with mode: 0755]
phrases [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2d19fc7
--- /dev/null
@@ -0,0 +1 @@
+*.html
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..ac3b702
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+Phrases - latin famous phrases in the terminal
+Copyright © 2020 Armaan Bhojwani <code@armaanb.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..e987763
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+.DEFAULT_GOAL := install
+
+install:
+       mkdir -p /usr/local/bin
+       mkdir -p /usr/share/phrases/
+       cp phrases /usr/local/bin
+       cp sources /usr/share/phrases/sources
+
+uninstall:
+       rm /usr/local/bin/phrases
+       rm -r /usr/share/phrases/
+
+reinstall:
+       rm /usr/local/bin/phrases
+       rm -r /usr/share/phrases/
+       mkdir -p /usr/local/bin
+       mkdir -p /usr/share/phrases/
+       cp phrases /usr/local/bin
+       cp sources /usr/share/phrases/sources
+
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..9e3f645
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+# phrases
+Get latin famous phrases in your terminal!
+
+## Source
+The Wikipedia page "[List of Latin phrases (full)](https://en.wikipedia.org/wiki/List_of_Latin_phrases_(full))". See the references [here](https://en.wikipedia.org/wiki/List_of_Latin_phrases_(full)#References) for more information
+
+## Installation
+`sudo make`
+
+## License
+Phrases is MIT Licensed by [Armaan Bhojwani](https://armaanb.net), 2020
diff --git a/extract.py b/extract.py
new file mode 100755 (executable)
index 0000000..a454569
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+# Tool to extract famous phrases from wikipedia
+from bs4 import BeautifulSoup
+import requests
+
+url = 'https://en.wikipedia.org/wiki/List_of_Latin_phrases_(full)'
+response = requests.get(url)
+html = response.content
+
+soup = BeautifulSoup(html, "html.parser")
+list_table = soup.find_all("table", attrs={"class":"wikitable"})
+
+output = []
+
+for table in list_table:
+    for row in table.find_all("tr")[1:]:
+        cell = row.find_all("td")
+        for content in cell:
+            text = content.get_text()
+            output.append(text)
+
+print(output)
+
diff --git a/phrases b/phrases
new file mode 100755 (executable)
index 0000000..f1f641a
--- /dev/null
+++ b/phrases
@@ -0,0 +1 @@
+#!/usr/bin/env bash