repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources15d ago| #1 | """Non-interactive test to post a tweet""" |
| #2 | |
| #3 | import asyncio |
| #4 | from config import load_config |
| #5 | from clients.twitter_client import TwitterClient |
| #6 | |
| #7 | |
| #8 | async def test_post_tweet(): |
| #9 | """Test posting a tweet without user input.""" |
| #10 | |
| #11 | print("🐦 Testing Twitter Post\n") |
| #12 | |
| #13 | # Load config |
| #14 | config = load_config() |
| #15 | |
| #16 | # Initialize Twitter client |
| #17 | twitter = TwitterClient( |
| #18 | consumer_key=config.twitter_consumer_key, |
| #19 | consumer_secret=config.twitter_consumer_secret, |
| #20 | access_token=config.twitter_access_token, |
| #21 | access_token_secret=config.twitter_access_token_secret, |
| #22 | bearer_token=config.twitter_bearer_token, |
| #23 | ) |
| #24 | |
| #25 | # Get user info |
| #26 | user_info = await twitter.get_authenticated_user() |
| #27 | print(f"Authenticated as: @{user_info['username']}") |
| #28 | |
| #29 | # Post a test tweet |
| #30 | test_tweet = "🌊 MAWD AI trading agent is now live with Twitter integration! Ready to share Solana trading insights. #Solana #AI #Crypto" |
| #31 | |
| #32 | print(f"\nPosting tweet: {test_tweet}") |
| #33 | print(f"Length: {len(test_tweet)} characters") |
| #34 | |
| #35 | result = await twitter.post_tweet(test_tweet) |
| #36 | |
| #37 | if result.success: |
| #38 | print(f"\n✓ Tweet posted successfully!") |
| #39 | print(f" Tweet ID: {result.tweet_id}") |
| #40 | print(f" URL: {result.url}") |
| #41 | else: |
| #42 | print(f"\n❌ Failed to post tweet: {result.error}") |
| #43 | |
| #44 | |
| #45 | if __name__ == "__main__": |
| #46 | asyncio.run(test_post_tweet()) |
| #47 |