How I used ChatGPT to help me create a custom app to help me automate my tasks in less than 24 hours 🙌
Unlocking the Developer Within: Harnessing AI Assistance to Create Custom Tools
Background
While experimenting with ChatGPT for research, I found it difficult to manually copy and paste text from websites or PDFs into the platform while keeping a manageable prompt.
Although I know that direct uploads of PDFs and web pages will be available soon, I decided to create my own app to have greater control over its features.
Once I receive my API key, I will complete the app. This tool will connect directly to ChatGPT and allow me to run custom prompts using the inputs generated from PDFs or websites.
I will share an update on this progress soon. Below are the steps I took to develop the app.
☑ Discussed the requirements: I wanted to build a custom app to scrape the contents of a URL (both web pages and PDFs) and convert the extracted text into a format that can be used as input for ChatGPT.
☑ Suggested a platform for testing: Chatgpt suggested using an online Jupyter Notebook (like Google Colab) for testing and development, as it's free and easy to set up.
☑ Developed the web page scraper: We started by creating a Python script to scrape the contents of a web page using the requests library and BeautifulSoup from the bs4 library. This script accepts a URL, fetches the HTML content, and extracts the text by parsing the HTML.
☑ Enhanced the scraper to support PDFs: We modified the script to support PDFs by incorporating the pdfplumber library. The script was updated to accept a URL or a file path, as well as an indication of whether the input is a PDF or not. The script then extracts the text from the PDF using pdfplumber and returns it as a string.
✅ Addressed issues with local file access: Due to the limitations of online Jupyter Notebooks, we faced some issues with accessing local files. I provided a solution using the google.colab library to upload local files to the notebook when running on Google Colab.
✅ Tested the scraper: We tested the scraper with various inputs, including web pages, PDFs from URLs, and local PDF files. We resolved any errors that arose during testing.
✅ Saved the code to GitHub: Chatgpt then guided me through the process of creating a new GitHub repository and pushing the code to the repository for safekeeping and easy access.
As a result, we successfully built a custom app that can scrape both web pages and PDFs from URLs or local files and output the extracted text to be used as input for ChatGPT. 🏆 #chatgpt #aimarketing #applicationdevelopment #sales&marketing tools
![Sample Code](https://static.wixstatic.com/media/01ba44_4c0edcd17e9749e7822b796544878f30~mv2.jpg/v1/fill/w_743,h_672,al_c,q_85,enc_auto/01ba44_4c0edcd17e9749e7822b796544878f30~mv2.jpg)
Comentários