Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

sopel-twitter

A Twitter plugin for Sopel.

Getting your API credentials

Twitter's developer application process has become rather tedious and annoying, involving a game of 20 questions with manual verification and sometimes long wait times. Unfortunately you'll need to go through it in order to use this plugin, since the API is needed to retrieve account data and rich link previews.

Once you have a Twitter developer account, you can create an app for your instance of sopel-twitter. You'll need the API Key (consumer_key) and Secret (consumer_secret) for your bot configuration.

Installation

Releases are hosted on PyPI, so after installing Sopel, all you need is pip:

$ pip install sopel-modules.twitter

If you want to use the development version, simply clone the repository and use pip install path/to/sopel-twitter

Configuring

The easiest way to configure sopel-twitter is using Sopel's configuration wizard – simply run sopel-plugins configure twitter and enter the credentials for the Twitter application you created.

Otherwise, you can edit your bot's configuration file:

[twitter]
consumer_key = YOUR_API_KEY_HERE
consumer_secret = YOUR_API_SECRET_HERE
# Optional: For quote-tweets, send a second message showing the quoted tweet?
# Default: True
show_quoted_tweets = True

Usage

Just send a link to a tweet or profile!

You can also retrieve a user's info with the .twitinfo command:

< Wiz> .twitinfo NASA
< Sopel> [Twitter] NASA (@NASA) ✔️ | Pale Blue Dot | http://www.nasa.gov/
         | 204 friends, 46,602,251 followers | 65,377 tweets, 13,040 ♥s
         | Joined: 2007-12-19 - 20:20:32UTC | There's space for everybody. ✨

Changes between 0.3.2 and 0.4.0

Added:

  • .twitinfo command for user lookup (#20)
  • Support for mobile links (#21)

Changed:

  • Updated documentation for configuration (#25) and setup of Twitter API account

Fixed:

  • Media link output when quoted tweets are involved (#24)

Changes between 0.3.1 and 0.3.2

Fixed:

  • Regression in profile link handling (#16)

Changes between 0.3.0 and 0.3.1

Fixed:

  • Stricter /i/ URL matching (#15)

Changes between 0.2.1 and 0.3.0

Changed:

  • Tweet output includes a timestamp now (#13)
  • Improved media link handling (#5, #12)

Added:

  • Handling for profile/user links (#7)
  • Handling for less common /i/web/status style links (#11)

Fixed:

  • Decode HTML entities before output (#14)

Changes between 0.2.0 and 0.2.1

Fixed:

  • Some quoted tweets would cause KeyError: 'text' (#9)

Changes between 0.1.2 and 0.2.0

Changed:

  • Now requires Sopel 7.x (#8)
  • Newlines in tweet text will be replaced with a carriage return symbol, to indicate author intention (#4)

Added:

  • Handling of 280-character tweets (#4)
  • More graceful handling of API errors (#6)

Meta:

  • Package metadata updated (new maintainer, HTTPS links)

Changes between 0.1.1 and 0.1.2

Added:

  • Tweet link handling

Changes between 0.1.0 and 0.1.1

Fixed:

  • Unicode on Python 3

Metadata

Release files for sopel-modules.twitter 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sopel-modules.twitter 0.4.0
File Size Uploaded Provenance Actions
sopel_modules.twitter-0.4.0.tar.gz 9.9 kB Without provenance Details for sopel_modules.twitter-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sopel-modules.twitter 0.4.0
File Interpreter ABI Platform Actions
sopel_modules.twitter-0.4.0-py3-none-any.whl Python 3 none any Details for sopel_modules.twitter-0.4.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / sopel_modules.twitter-0.4.0.tar.gz

Download URL sopel_modules.twitter-0.4.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
75e8c23144415c54f1947f00d9ef2e331c2b61f5c0d65c2281cbc883e5d2b7c1
BLAKE2b-256 checksum
How to use checksums
dc2a792e4d95dac1046499df4cfd38ca1c863bc8a57ba66f1168e96ab092bde4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/56.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Release files / sopel_modules.twitter-0.4.0-py3-none-any.whl

Download URL sopel_modules.twitter-0.4.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfac488003a59d31fe4b359ad7c6de819cf1b237dcf095ffb18ff96c86e45c2e
BLAKE2b-256 checksum
How to use checksums
bc406af53789f85deadf1c402ec6ea7b44fc53ffb0a8e5826c2fbbcde984997d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/56.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Security for sopel-modules.twitter 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page