This repository provides a simplified blueprint for a browser extension designed to measure activities on Twitter/X and manipulate the feed in real-time.
Compatibility: Chrome and Edge.
This project comprises two main components:
events.js: Manages user interactions and event handling within the extension.logic.js: Contains the core logic for re-ranking and modifying the feed. This example sends the content to the server for re-ranking.injected.js: Injects custom scripts into the Twitter/X web page to override XMLHttpRequest behavior.launcher.js: Initializes the extension and sets up necessary configurations.libs/: Contains utility scripts and libraries, such as jQuery, to support the extension’s functionality.BrowserExtension folder as an unpacked extension in your Chrome or Edge browser.pip install -r requirements.txt. Start the server with python main.py. In production, we recommend using a WSGI server (e.g., Gunicorn). In this implementation, the server is minimal and can be easily ported to other languages.events.jsRefer to this article for more information:
Reranking Social Media Feeds: A Practical Guide for Field Experiments
Social media plays a central role in shaping public opinion and behavior, yet performing experiments on these platforms and, in particular, on feed algorithms is becoming increasingly challenging. This article offers practical recommendations to researchers developing and deploying field experiments focused on real-time re-ranking of social media feeds. The article is organized around two main contributions:
An overview of an experimental method using web browser extensions that intercept and re-rank content in real-time, enabling naturalistic re-ranking field experiments on participants’ actual feeds, without requiring the involvement of social media platforms.
Concrete technical recommendations for intercepting and re-ranking social media feeds with minimal user-facing delay, along with an open-source implementation. This document aims to summarize lessons learned, provide concrete implementation details, and foster the ecosystem of independent social media research.
Tiziano Piccardi, Martin Saveski, Chenyan Jia, Jeffrey Hancock, Jeanne L. Tsai, Michael S. Bernstein
Read the full paper here.
@article{piccardi2024reranking,
title={Reranking Social Media Feeds: A Practical Guide for Field Experiments},
author={Piccardi, Tiziano and Saveski, Martin and Jia, Chenyan and Hancock, Jeffrey and Tsai, Jeanne L and Bernstein, Michael S},
journal={arXiv preprint arXiv:2406.19571},
year={2024}
}