jarylc/carousell-gobot

By jarylc

Updated almost 3 years ago

A Carousell.sg automation bot written in Golang

Image
Integration & delivery
Web servers
0

9.3K

jarylc/carousell-gobot repository overview

Carousell Gobot Logo

Carousell GoBot

A Carousell.sg automation bot written in Golang

WARNING: NIGHTLY RELEASES ONLY. Expect bugs and possibly breaking changes every update.

Explore the docs »

Report Bugs · Request Features

About The Project

Demo
Initial auto-reply

Initial auto-reply

Low-balling detection

Low-balling detection

Lower official offer detection

Lower official offer detection

Forwarding to other chat services

Forwarding to other chat services

Reminders & Commands

Reminders & Commands Reminders

Built With

Getting Started

1. Prepare configuration file
  1. Click here to download the latest sample config
  2. Rename config.sample.yaml to config.yaml
  3. Edit config.yaml with your configurations (breakdown below)
2a. Docker Run
docker run -it -d \
  --name carousell-gobot \
  -e TZ=UTC \
  -v /path/to/config/folder:/data \
  jarylc/carousell-gobot
2b. Docker-compose
carousell-gobot:
    image: jarylc/carousell-gobot
    environment:
      - TZ=UTC
    volumes:
      - /path/to/config/folder:/data

Usage

Firefox
  1. Go to https://www.carousell.sg/
  2. Press CTRL+SHIFT+E / ⌘+⌥+E
  3. Refresh the page
  4. Firefox Final Step
Chrome
  1. Go to https://www.carousell.sg/
  2. Press CTRL+SHIFT+C / ⌘+⌥+C
  3. Click on Network tab
  4. Refresh the page
  5. Chrome Final Step
Commands (prefixed with command_prefix configuration)

Currently, only your account can send these commands:

  • sched/schedule/remind/reminder/deal - schedule a deal and set reminders based on reminders configuration
    • arguments: date/day and time (optional)
    • if no arguments, it will read the most recent reply and response
    • uses natural date processing. ELI5: something like a simple AI to detect dates in sentences.
  • cancel/del/delete - cancel deal & reminders
  • faq - resend the FAQ
  • contact - send contact details
  • stop - immediately stop the bot
Configuration
Sample

https://gitlab.com/jarylc/carousell-gobot/-/blob/master/config.sample.yaml

Breakdown
  • application - application related configurations
    • base_url - base URL of front-end portal (to be sent to forwarders on 2FA or Captcha requests)
    • portal_listener - listen address for front-end
    • chrome_listener - listen address for Chrome remote debugger
  • carousell - Carousell related configurations
    • cookie - either this or username and password or both are required, entire value inside Cookie header from above
    • username - either this or cookie or both are required, specify username for automatic session renewal (if Docker, make sure to run with env INSTALL_CHROME=1)
    • password - either this or cookie or both are required, specify password for automatic session renewal (if Docker, make sure to run with env INSTALL_CHROME=1)
    • ping_interval - interval to ping Carousell to check connectivity
    • low_ball - percentage of price to be considered low-ball in decimal notation
  • message_templates - message templates
    • faq - frequently answered questions (optional, leave empty if not required)
    • initial - new chat initial greeting (placeholders available)
      • {{NAME}} - name of sender
      • {{ITEM}} - name of item
    • not_available - chat message on a listing that is sold, reserved or deleted (placeholders available)
      • {{REASON}} - reason why listing is not available anymore
    • offered - official offer using Carousell's offer button (placeholders available)
      • {{OFFER}} - offer value
    • possible_offer - offer value detected from previously sent message (placeholders available)
      • {{OFFER}} - offer value
    • lower_offer - official offer value was decreased from possible offer, buyer being cheeky?
    • low_balled - low-balled (placeholders available)
      • {{PERCENT}} - low-ball percent configured in configuration in percent notation
    • contact - contact details reply for contact command
    • reminder - reminder (placeholders available)
      • `{{HOURS}}' - hours remaining till scheduled time
  • reminders - list of hours to set reminders for on every deal (optional, leave empty if none)
  • command_prefix - prefix to use for the app to detect as a command
  • state_prune - number of days to keep items in state after last activity
  • forwarders - list of forwarders (optional, [] if none)
    • for telegram (guide: https://core.telegram.org/bots):
      • - type: telegram
          token: '1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZabcde1234' # bot token
          chat_id: 87654321 # chat id
          message_templates:
          standard: |- # standard message
            *Carousell Chat/Offer*
            [{{NAME}} - {{ITEM}}](https://www.carousell.sg/inbox/{{ID}})
            ${{OFFER}}
            {{FLAGS}}
          reminder: |- # reminder message
            *Carousell Deal Reminder*
            [{{ITEM}}](https://www.carousell.sg/inbox/{{ID}})
            Deal ${{OFFER}} in {{HOURS}} hour(s)!
        
    • for discord (webhook only, guide: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks):
      • - type: discord
          webhook_url: 'https://discord.com/api/webhooks/012345678910111213/lrennsXdocFAKEdOWAkpWEBHOOKMrMMcXa_FcmCURLUMNU_STsnbKVTRirmvLccmvkpA' # webhook url
          message_templates:
          standard: |- # standard message
            **Carousell Chat/Offer**
            [{{NAME}} - {{ITEM}}](https://www.carousell.sg/inbox/{{ID}})
            ${{OFFER}}
            {{FLAGS}}
          reminder: |- # reminder message
            **Carousell Reminder**
            [{{ITEM}}](https://www.carousell.sg/inbox/{{ID}})
            Deal ${{OFFER}} in {{HOURS}} hour(s)!
        
    • for slack (webhook only, guide: https://api.slack.com/messaging/webhooks):
      • - type: slack
          webhook_url: 'https://hooks.slack.com/services/T1234GN5678/B1FAKEZNRCM/fPoWEBHOOK2Yyn3oURLOjW4J' # webhook url
          message_templates:
          standard: |- # standard message
            *Carousell Chat/Offer*
            <https://www.carousell.sg/inbox/{{ID}}|{{NAME}} - {{ITEM}}>
            ${{OFFER}}
            {{FLAGS}}
          reminder: |- # reminder message
            *Carousell Reminder*
            <https://www.carousell.sg/inbox/{{ID}}|{{ITEM}}>
            Deal ${{OFFER}} in {{HOURS}} hour(s)!
        

Roadmap

See the open issues for a list of proposed features (and known issues).

License

Distributed under the GNU GENERAL PUBLIC LICENSE V3. See LICENSE for more information.

Contact

Jaryl Chng - [email protected]

https://jarylchng.com

Project Link: https://gitlab.com/jarylc/carousell-gobot/

Tag summary

Content type

Image

Digest

sha256:70de79310

Size

10 MB

Last updated

almost 3 years ago

docker pull jarylc/carousell-gobot