You are not logged in.

#1 2019-09-03 15:50:53

mapolidori
Member
Registered: 2018-01-27
Posts: 8

oxd - A simple CLI for definitions/synonyms from Oxford Dictionaries

Earlier this year, I released my first project in the AUR. It's a CLI to retrieve definitions and synonyms from the Oxford Dictionaries website. I decided to post it here to get some feedback and see if anyone runs in to any issues.

AUR: https://aur.archlinux.org/packages/python-oxd-git/
GitHub: https://github.com/mpolidori/python-oxd

Offline

#2 2019-09-03 20:11:02

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,970
Website

Re: oxd - A simple CLI for definitions/synonyms from Oxford Dictionaries

Your python script seems to be a web scraper for lexico.com on first glance.
You do a lot of scraping by manipulating strings, wich seems very obscure and might be unstable when characters within the website change.
Have a look at the beautiful soup library for web scraping with python in case you consider refactoring.

Last edited by schard (2019-09-03 20:12:30)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#3 2019-09-04 01:57:37

mapolidori
Member
Registered: 2018-01-27
Posts: 8

Re: oxd - A simple CLI for definitions/synonyms from Oxford Dictionaries

schard wrote:

Your python script seems to be a web scraper for lexico.com on first glance.
You do a lot of scraping by manipulating strings, wich seems very obscure and might be unstable when characters within the website change.
Have a look at the beautiful soup library for web scraping with python in case you consider refactoring.

At some point since I wrote this, the Oxford Dictionaries site began redirecting to Lexico. It says powered by Oxford. I'm not sure why they changed it. Maybe they merged with Lexico or something. They should still be the official definitions from Oxford.

I have used BeatifulSoup before. I have only recently become more comfortable with it. I attempted to use it initially, but I had trouble getting all the tags I needed in the exact order as they're presented on the page (I didn't realize I could find_all for multiple tags, in order, in one pass). I have considered rewriting some of it now that I'm a bit more knowledgeable, but I haven't attempted anything yet. Maybe I'll look in to it this weekend.

Thanks, I appreciate the feedback!

Offline

Board footer

Powered by FluxBB