Skip to main content
The Affiliate Marketing feature automates the process of promoting affiliate products. Scrape product details from Amazon, generate AI-powered pitches, and share them directly to your Twitter accounts.

Overview

MoneyPrinter V2 streamlines affiliate marketing workflows:
1

Product Scraping

Extract product title and features from Amazon affiliate links
2

Pitch Generation

AI creates compelling promotional content based on product details
3

Social Sharing

Automatically post pitches to connected Twitter accounts
4

Link Inclusion

Affiliate links are appended to generated pitches for tracking

Setup Requirements

Prerequisites

Twitter Account

A configured Twitter account in MoneyPrinter V2 (see Twitter Bot setup)

Affiliate Links

Valid Amazon affiliate links (or other platforms following similar HTML structure)

Firefox Profile

Same authenticated Firefox profile used for Twitter posting

Configuration

No additional configuration needed—uses existing Twitter and browser settings.

Product Management

Adding a Product

From the main menu, select Affiliate Marketing:
Starting Affiliate Marketing...
No products found in cache. Create one now?
Yes/No: Yes

=> Enter the affiliate link: https://www.amazon.com/dp/B08N5WRWNW?tag=youraffid-20
=> Enter the Twitter Account UUID: 123e4567-e89b-12d3-a456-426614174000
You’ll need the UUID of an existing Twitter account. View UUIDs from the Twitter Bot account selection menu.

Product Scraping Process

def scrape_product_information(self) -> None:
    # Open the affiliate link
    self.browser.get(self.affiliate_link)

    # Get the product name
    product_title: str = self.browser.find_element(
        By.ID, AMAZON_PRODUCT_TITLE_ID
    ).text

    # Get the features of the product
    features: Any = self.browser.find_elements(By.ID, AMAZON_FEATURE_BULLETS_ID)

    if get_verbose():
        info(f"Product Title: {product_title}")

    if get_verbose():
        info(f"Features: {features}")

    # Set the product title
    self.product_title: str = product_title

    # Set the features
    self.features: Any = features
The system:
  1. Opens the affiliate link in a browser
  2. Locates product title using Amazon’s element IDs
  3. Extracts feature bullet points
  4. Stores information for pitch generation
Currently optimized for Amazon product pages. Other platforms may require code modifications to match different DOM structures.

Pitch Generation

AI creates promotional content based on scraped product data:
def generate_pitch(self) -> str:
    # Generate the response
    pitch: str = (
        self.generate_response(
            f'I want to promote this product on my website. Generate a brief pitch about this product, return nothing else except the pitch. Information:\nTitle: "{self.product_title}"\nFeatures: "{str(self.features)}"'
        )
        + "\nYou can buy the product here: "
        + self.affiliate_link
    )

    self.pitch: str = pitch

    # Return the response
    return pitch

Pitch Characteristics

Feature-Focused

AI emphasizes key product features from scraped data

Concise Format

Brief pitches suitable for social media (Twitter-length friendly)

Affiliate Link

Your affiliate link is automatically appended to the pitch

Natural Language

Generated in conversational style, not overly promotional

Example Generated Pitch

This wireless keyboard is a game-changer for productivity! Features include:
- Bluetooth 5.0 connectivity for seamless pairing
- 30-hour battery life on a single charge
- Ergonomic design that reduces wrist strain
- Compatible with Windows, Mac, and tablets

Perfect for remote workers and students alike.
You can buy the product here: https://www.amazon.com/dp/B08N5WRWNW?tag=youraffid-20

Social Media Sharing

After pitch generation, the system automatically posts to your Twitter account:
def share_pitch(self, where: str) -> None:
    if where == "twitter":
        # Initialize the Twitter class
        twitter: Twitter = Twitter(
            self.account_uuid,
            self.account_nickname,
            self._fp_profile_path,
            self.topic,
        )

        # Share the pitch
        twitter.post(self.pitch)

Sharing Workflow

1

Twitter Initialization

Creates a Twitter bot instance using the account you specified
2

Post Creation

Calls the Twitter bot’s post() method with the generated pitch
3

Browser Automation

Opens Twitter compose screen and enters pitch text
4

Publication

Clicks the Post button to publish the tweet
5

Cache Update

Saves the post to Twitter cache for history tracking
Currently only Twitter is supported as a sharing platform. The where parameter is designed for future expansion to other platforms.

Complete Workflow Example

Here’s a full affiliate marketing session:
# 1. Start Affiliate Marketing
Select an option: 3
Starting Affiliate Marketing...

# 2. Add Product
No products found in cache. Create one now?
Yes/No: Yes

=> Enter the affiliate link: https://www.amazon.com/dp/B08N5WRWNW?tag=myaff-20
=> Enter the Twitter Account UUID: 550e8400-e29b-41d4-a716-446655440000

# 3. System automatically:
# - Scrapes product information
Product Title: Logitech MX Keys Wireless Keyboard
Features: [Feature elements...]

# - Generates pitch
Generating pitch...

# - Posts to Twitter
=> Posting to Twitter: This wireless keyboard is a...
Posted to Twitter successfully!

Managing Multiple Products

When you’ve added products, they appear in a selection table:
+----+-------------------------------------------------------+-----------------------------------------+
| ID | Affiliate Link                                        | Twitter Account UUID                    |
+----+-------------------------------------------------------+-----------------------------------------+
| 1  | https://www.amazon.com/dp/B08N5WRWNW?tag=myaff-20    | 550e8400-e29b-41d4-a716-446655440000   |
| 2  | https://www.amazon.com/dp/B07XYZ123?tag=myaff-20     | 550e8400-e29b-41d4-a716-446655440000   |
+----+-------------------------------------------------------+-----------------------------------------+

Select a product to start: 1
Selecting a product triggers:
  1. Scraping product information
  2. Generating a new pitch
  3. Posting to the associated Twitter account
You can promote the same product multiple times—each selection generates a fresh pitch with different wording.

Product Cache

Products are stored in .mp/cache/afm_cache.json:
{
  "products": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "affiliate_link": "https://www.amazon.com/dp/B08N5WRWNW?tag=myaff-20",
      "twitter_uuid": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}

Troubleshooting

Cause: Amazon changed their HTML structure, or the page is a non-product page.Solution:
  1. Verify the link opens a product detail page
  2. Check constants.py for AMAZON_PRODUCT_TITLE_ID definition
  3. Inspect Amazon’s page HTML to update element IDs if changed
Cause: Feature bullet points use different element IDs than expected.Solution: Update AMAZON_FEATURE_BULLETS_ID in constants.py to match current Amazon structure.
Cause: Product features weren’t scraped properly, so AI has limited context.Solution:
  1. Verify features are being extracted (check verbose logs)
  2. Manually test scraping on the product page
  3. Consider adding more context in the pitch generation prompt
Cause: Twitter account authentication issues (see Twitter Bot troubleshooting).Solution: Verify the Firefox profile is still logged into Twitter.

Best Practices

Product Selection

Choose products relevant to your Twitter account’s topic for authentic promotion

Pitch Variety

Re-generate pitches for the same product periodically to avoid repetitive content

Compliance

Include #ad or #affiliate hashtags if required by FTC or local regulations

Genuine Promotion

Only promote products you’ve researched or believe in for audience trust

Link Tracking

Monitor your affiliate dashboard to track which products generate conversions

Spacing Posts

Don’t spam affiliate links—mix with regular content on your Twitter account

Extending to Other Platforms

While currently Amazon-focused, you can adapt the code for other affiliate networks:

Required Changes

  1. Update Scraping Logic (AFM.py:91):
    # For different e-commerce sites, update element selectors
    product_title = self.browser.find_element(By.CLASS_NAME, "product-title").text
    features = self.browser.find_elements(By.CLASS_NAME, "feature-item")
    
  2. Add Platform Detection:
    def get_platform(self) -> str:
        if "amazon.com" in self.affiliate_link:
            return "amazon"
        elif "clickbank.com" in self.affiliate_link:
            return "clickbank"
        # Add more platforms
    
  3. Platform-Specific Scrapers:
    def scrape_product_information(self) -> None:
        platform = self.get_platform()
        
        if platform == "amazon":
            self.scrape_amazon()
        elif platform == "clickbank":
            self.scrape_clickbank()
    

Future Enhancements

Potential additions to the affiliate marketing feature:
  • Multi-platform sharing: Facebook, Instagram, LinkedIn
  • Image extraction: Scrape and include product images in posts
  • Scheduled campaigns: Promote products at optimal times
  • A/B testing: Generate multiple pitch variations and track performance
  • Conversion tracking: Integrate with affiliate network APIs

Source Code Reference

  • Affiliate Marketing class: src/classes/AFM.py
  • Menu interface: src/main.py:353-412
  • Cache management: src/cache.py
  • Amazon element constants: src/constants.py

Build docs developers (and LLMs) love