0% found this document useful (0 votes)
8 views3 pages

Instagram API Integration and Tweeting

The document outlines a backend development assignment consisting of two parts: fetching data from the bbcnews Instagram page and summarizing it for posting on X.com. The first part involves creating a module for retrieving the latest post's caption and image, with error handling and documentation. The second part focuses on integrating an LLM for summarization and posting the tweet via an API, along with testing and comprehensive documentation requirements for both parts.

Uploaded by

Living Lords
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Instagram API Integration and Tweeting

The document outlines a backend development assignment consisting of two parts: fetching data from the bbcnews Instagram page and summarizing it for posting on X.com. The first part involves creating a module for retrieving the latest post's caption and image, with error handling and documentation. The second part focuses on integrating an LLM for summarization and posting the tweet via an API, along with testing and comprehensive documentation requirements for both parts.

Uploaded by

Living Lords
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Backend Dev Assignment

Part 1: Instagram Data Fetching and API Integration (Easy)


Objective

Create a module that connects to Instagram (or simulates the connection) to fetch the caption (and
image photo) from the most recent post on the bbcnews Instagram page.

Task Details

●​ Instagram Data Retrieval:


○​ Develop a service to retrieve the latest post’s caption and image URL from the
Instagram account.
○​ If real Instagram API access is unavailable, then try to webscrape or crawl.
●​ Error Handling & Logging:
○​ Implement error handling for common issues (e.g., network errors, API rate limits).
●​ Documentation:
○​ Document how to use the module, including how to change the target Instagram
username.

Acceptance Criteria

●​ A working module that returns the caption (and if possible image) from bbcnews instagram
handle.
●​ Clear code documentation and inline comments.
●​ Robust error handling with appropriate logging.
Part 2: Caption Summarization and [Link] API Integration
(Advanced)
Objective

Integrate an LLM to summarize the fetched Instagram caption into a tweet and implement an
endpoint that triggers posting this tweet to an [Link] account.

Task Details

●​ LLM Summarization Module:


○​ Create a module that accepts an Instagram caption and uses an LLM (ChatGPT,
DeepSeek, etc.) to generate a concise tweet summary.
○​ Ensure the summarized text meets the tweet character limit (e.g., 280 characters)
while retaining the core message.
●​ [Link] API Integration:
○​ Integrate with the [Link] API (or use a simulation/mock if necessary) to post tweets.
○​ Develop an API endpoint (e.g., /post-tweet) that accepts a summarized caption
and posts it to the designated [Link] account.
●​ Testing & Documentation:
○​ Write unit tests for the summarization and tweet posting workflows.
○​ Update API documentation with usage instructions, input parameters, and expected
responses.

Acceptance Criteria

●​ A functional LLM module that correctly summarizes Instagram captions.


●​ Successful integration with the [Link] posting mechanism.
●​ A well-documented API endpoint that triggers tweet posting.
●​ Unit tests covering the key functions.

Final Submission Guidelines


●​ Code Repository:
○​ Host your code on a platform like GitHub with a clear commit history.
○​ Organize the code modularly, separating concerns for Instagram fetching, LLM
summarization, [Link] integration, and automation.
●​ Documentation:
○​ Provide a detailed README (or separate documentation) that includes:
■​ System overview and architecture.
■​ Setup instructions and environment requirements.
■​ API endpoint details and usage examples.
■​ Configuration instructions for setting a custom Instagram username.
■​ Deployment steps (including Docker containerization if applicable).
■​ Instructions for scheduling and automation.
●​ Testing:
○​ Include unit tests and integration tests for:
■​ Instagram data retrieval.
■​ Caption summarization.
■​ Tweet posting (with and without images).
■​ Customization and configuration changes.
○​ Document test cases and expected outcomes.

Note: Wherever you feel the software is paid or not free, feel free to use a substitute free/open source software. Also feel
free to take assumptions wherever necessary. We are more interested in seeing your capability than the final output. If you
are not able to attempt both the parts of the assignment, try to attempt whatever is possible. Needless to say we will
prioritise those who complete both the parts.

As there are too many applicants, we will not be able to answer individual questions/queries so reach out only if there is a
genuine concern with the assignment. Also request you to refrain from emailing or reaching out on social media platforms.

Common questions

Powered by AI

Modular code organization is essential as it promotes separation of concerns, making the software more manageable and maintainable. Each module can be developed, tested, and debugged independently, which improves code clarity and scalability. In the context of Instagram data fetching and tweet posting, separate modules would handle the Instagram API interface, caption summarization, and tweet posting, each with its testing and documentation. This separation simplifies debugging and enhances flexibility, allowing for more straightforward updates and replacements of individual modules. In final project submissions, modular design facilitates clearer documentation, making it easier for examiners to assess each component's functionality and integration .

Unit testing is crucial in developing modules for social media data processing and integration as it ensures each functionality works correctly in isolation before integration into larger systems. It helps catch errors early in the development process, reducing debugging time and costs later. Unit tests validate that modules perform as expected under various conditions, which is vital for managing data retrieval, summarization, and posting workflows. This systematic verification increases confidence in the stability and reliability of the software, supports continuous integration practices, and aids in maintaining software quality over time as updates occur .

Overcoming limitations of simulated APIs or web scraping involves strategies such as leveraging headless browsers to accurately mimic user interactions, implementing robust data parsing and cleaning to handle inconsistent data structures, and employing scheduling mechanisms for timely data updates despite limitations. Implications include potential data integrity issues due to HTML structure changes on Instagram's website, and legal considerations related to terms of service violations when web scraping. Using simulated APIs requires maintaining synchronization with official API structures to ensure seamless transition if real API access becomes available. These strategies help maintain functionality and reliability, though they require ongoing monitoring and adaptation .

Effective error handling and logging can be implemented by anticipating common issues such as network errors, API rate limits, and data parsing issues. This can be achieved by using try-except blocks for catching exceptions, setting up retry mechanisms for transient errors, and logging error details for further analysis and debugging. Implementing robust logging can help track the service's performance and identify persistent problems, thus facilitating timely troubleshooting. These features are critical as they ensure the reliability and maintainability of the module, minimizing downtime and improving user experience .

Automation can improve efficiency and reliability by scheduling regular data retrieval and tweet posting, reducing manual intervention and human error. Automated processes enable consistent performance and timely updates, ensuring that the content is up-to-date. However, potential pitfalls include dependency on scheduled tasks, which can fail if not monitored correctly, leading to oversight of errors or outages. Another concern is the complexity of automating tasks like web scraping, which can lead to issues if target sites change their layout or data access policies. Implementing proper fallback mechanisms and continuous monitoring is essential to counter these challenges .

Integrating a large language model (LLM) to summarize Instagram captions involves several considerations and steps. Firstly, the LLM must be capable of condensing text while preserving its meaning, which necessitates training or selecting a model proficient in natural language processing (NLP). Additionally, developers must ensure the output adheres to the character limit of tweets (280 characters). Challenges might include ensuring the model's output retains the original message's context and tone, managing computational resources effectively, and addressing potential biases in the LLM. Furthermore, developers need to continuously test and refine the model to handle diverse types of content and linguistic intricacies .

Detailed README files are pivotal in software projects as they provide a comprehensive overview of the project's function, structure, and use cases. In the context of the Instagram data module and tweet posting system, a README would explain how to set up the environment, configure APIs, and implement the system, thus serving as a primary reference for developers. It facilitates understanding by outlining system architecture, usage instructions, and provides examples necessary for proper implementation. This clarity supports both initial setup and long-term maintenance, enhancing user familiarity and project adoption .

To develop a service that retrieves the latest Instagram post's caption and image URL from the bbcnews Instagram account, the essential components include accessing the Instagram API or employing web scraping techniques if API access is restricted. This involves establishing a connection to Instagram's platform, parsing the necessary data, and handling authentication if required. Challenges that may arise include managing API rate limits, handling unauthorized access issues, and ensuring data consistency. Error handling needs to be implemented to cope with network errors and potential changes in Instagram's layout if web scraping is used .

Documenting customization and configuration processes involves providing clear and detailed instructions on how to adjust various settings, such as changing the target Instagram username, managing API keys or web scraping configurations, and setting different operational parameters. It should include examples, potential pitfalls, and troubleshooting tips to ensure usability. Effective documentation supports scalability by enabling users to adapt the module to different environments or requirements with minimal difficulty. This approach reduces the learning curve for new users and assists in seamless integration into diverse systems .

Creating a well-documented API endpoint involves defining the endpoint's functionality, specifying input parameters, describing the processing workflow, and outlining expected responses. It requires clear and concise documentation of how to use the API, including example requests and responses, authentication requirements, and potential error codes. Documentation is crucial because it ensures users understand how to integrate and interact with the API, reducing integration errors and facilitating troubleshooting. Comprehensive documentation promotes consistent usage and adoption by providing a reliable reference for developers .

You might also like