Skip to content

Instantly share code, notes, and snippets.

@bcantoni
bcantoni / friends.php
Last active July 12, 2022 21:46
Use Twitter API to export data (in CSV format) on people you are following. See Installation notes for steps. Prerequisites: 1) Twitter OAuth PHP library 2) Create your own Twitter application and OAuth keys/tokens.
<?php
/* friends.php - use Twitter API to export data (CSV format) on people you are following
Installation:
1. Install Twitter OAuth PHP library (https://github.com/abraham/twitteroauth)
2. Adjust twitteroauth.php include path below
3. Create Twitter application (https://dev.twitter.com/apps)
4. Fill in 4 Twitter app keys below
5. Adjust $fields array if you want different fields saved