> For the complete documentation index, see [llms.txt](https://shrimp-2.gitbook.io/shrimp-cat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shrimp-2.gitbook.io/shrimp-cat/shrimp-cat-docs/community-engagement.md).

# Community Engagement

There some code of how it works:

```python
import openai
import tweepy

# OpenAI and Twitter API Keys
OPENAI_API_KEY = "your_openai_api_key"
TWITTER_API_KEYS = {
    "consumer_key": "your_consumer_key",
    "consumer_secret": "your_consumer_secret",
    "access_token": "your_access_token",
    "access_token_secret": "your_access_token_secret"
}

# Authenticate OpenAI
openai.api_key = OPENAI_API_KEY

# Authenticate Twitter
auth = tweepy.OAuthHandler(TWITTER_API_KEYS["consumer_key"], TWITTER_API_KEYS["consumer_secret"])
auth.set_access_token(TWITTER_API_KEYS["access_token"], TWITTER_API_KEYS["access_token_secret"])
twitter_api = tweepy.API(auth)

# Generate a Tweet
def generate_tweet(prompt):
    response = openai.Completion.create(
        engine="text-davinci-003",
        prompt=prompt,
        max_tokens=50
    )
    return response.choices[0].text.strip()

# Post Tweet
def post_tweet(content):
    twitter_api.update_status(content)

# Main Function
if __name__ == "__main__":
    prompt = "Write a funny crypto-themed tweet from a shrimp-cat perspective."
    tweet = generate_tweet(prompt)
    post_tweet(tweet)
    print(f"Tweet posted: {tweet}")

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://shrimp-2.gitbook.io/shrimp-cat/shrimp-cat-docs/community-engagement.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
