Overview
This prompt aims to guide a senior developer in integrating a progress bar into an existing JavaScript and PHP function. Developers working on similar projects will benefit from the structured approach and detailed instructions provided.
Prompt Overview
Purpose: This task aims to integrate a progress bar into the `fetchAllGooglePages` function to enhance user experience.
Audience: The intended audience includes developers familiar with JavaScript and PHP who seek to improve their code’s interactivity.
Distinctive Feature: The progress bar will update dynamically, reflecting the real-time status of the page-fetching process.
Outcome: Users will receive visual feedback on the progress of the function, improving engagement and usability.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, General Business Operations, Property Development
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
As a senior JavaScript and PHP developer, analyze the following code in detail. Your primary task is to integrate a progress bar that reflects the progress of the function `fetchAllGooglePages`.
You must keep the existing code structure intact and only modify or add the necessary components to implement the progress bar.
## Steps
1. Review the code to understand its structure and the logic of the `fetchAllGooglePages` function.
2. Identify where in the process you can track progress and display updates on the progress bar.
3. Implement a progress bar using JavaScript (and PHP if server-side interaction is required) that dynamically updates as `fetchAllGooglePages` progresses.
## Output Format
– Provide the modified code, ensuring all added or changed components are clearly marked and explained.
– Include comments within the code to highlight and explain the added progress bar functionality.
– Ensure the code is clear, functional, and demonstrates the progress bar working seamlessly with `fetchAllGooglePages`.
## Notes
– Ensure all implementations are compatible with current web standards and best practices.
– Consider edge cases and potential pitfalls within the function when implementing the progress bar.
– Make sure your implementation does not introduce any errors or impede the current functionality.
– Assume no additional external libraries are to be used unless absolutely necessary.
Screenshot Examples
How to Use This Prompt
- Copy the prompt to your clipboard.
- Open your preferred code editor or IDE.
- Paste the prompt into a new document.
- Follow the steps outlined in the prompt carefully.
- Test the modified code to ensure the progress bar works.
- Review and refine your implementation as needed.
Tips for Best Results
- Understand the Code: Thoroughly review the `fetchAllGooglePages` function to identify key points for progress tracking.
- Track Progress: Insert progress updates at logical intervals within the function, such as after each page fetch.
- Implement Progress Bar: Use JavaScript to create a simple progress bar element and update its width based on the progress tracked.
- Test Thoroughly: Ensure the progress bar updates correctly under various conditions and does not disrupt the existing functionality.
FAQ
- What is the purpose of the progress bar in the function?
The progress bar visually indicates the completion status of the fetchAllGooglePages function. - How can progress be tracked during execution?
Progress can be tracked by updating the bar after each page fetch within the function. - What technologies are used to implement the progress bar?
JavaScript is used for the progress bar on the client side, with possible PHP for server-side updates. - What should be considered to avoid errors?
Ensure proper error handling and edge case management during the fetching process to maintain functionality.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


