Skip to main content

Featured

Week 12: Release 0.4 Part: 3

Release 0.4 Part 3 This is going to be my final post for this class which covers my final update on my Release 0.4. Earlier this week I made a PR that ports SearchBar to NextJS but I'm still waiting for it to be reviewed some more. I've had some feedback that I have implemented and have also requested a review again. Overall this Release went pretty smoothly for the actually GitHub side of things like setting up the issue, making the PR, and so on. In Release 0.3 I wasn't so certain on how this process happened with Telescope, but now I never had these issues for 0.4. Issue #1470 Fix #1470: Port SearchBar from Gatsby -> NextJS #1503 Did I Meet My Goals? Going into this release I had two main goals: 1. Setup the Issue/PR with no issues 2. Learn about NextJS I feel like I meet both of these goals at the end. I had no issues setting up my branch, updating my master, making the issue, making the PR, and following through on review comments so far. When it comes to learning m

Week 8: Release 0.3 PR#1

OTO Helper

For release 0.3 I need to make two pull requests. The first being one in the telescope project and the other being in an external project. The external project is supposed to be an improvement from my other 4 PR's. Fortunately during Hacktoberfest I made a few more then necessary PR's, and one of my last one's was not included in release 0.2. This PR had me working in python to add a URL validator to a video downloading function.

Here's the issue: Issue #2

The project itself was called OTO Helper and is currently being developed as a helper library that provides utility modules for other projects linked to this one. 

OTO Helper

The Code

Im not used to working with python so it took me a little while to research and get the code working correctly. This new addition had me adding a regex pattern to check the URL using regex.search(). If there was an issue I would then raise an exception. 

regex = re.compile(
        r'^https?://'
        r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|'
        r'localhost|'
        r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'
        r'(?::\d+)?'
        r'(?:/?|[/?]\S+)$', re.IGNORECASE)
    if not regex.search(url):
        raise Exception("Error! Given URL is not a valid URL.")

Here's the PR: Validate URL that is passed to video_downloader.py

Thanks,

Matthew Stewardson 

Comments

Popular Posts