{"id":19234578,"url":"https://github.com/smitelli/twitstash","last_synced_at":"2025-04-21T05:31:11.072Z","repository":{"id":5450853,"uuid":"6644443","full_name":"smitelli/twitstash","owner":"smitelli","description":"Keeps a copy of a user's tweets in a MySQL database.","archived":false,"fork":false,"pushed_at":"2022-08-31T02:04:00.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-22T22:36:47.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smitelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-11T21:03:34.000Z","updated_at":"2022-05-03T21:39:21.000Z","dependencies_parsed_at":"2023-01-11T16:48:52.865Z","dependency_job_id":null,"html_url":"https://github.com/smitelli/twitstash","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitelli%2Ftwitstash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitelli%2Ftwitstash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitelli%2Ftwitstash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smitelli%2Ftwitstash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smitelli","download_url":"https://codeload.github.com/smitelli/twitstash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223849217,"owners_count":17213640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T16:14:19.848Z","updated_at":"2024-11-09T16:14:20.489Z","avatar_url":"https://github.com/smitelli.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"twitstash\n=========\n\nKeeps a copy of a user's tweets in a MySQL database.\n\nby [Scott Smitelli](mailto:scott@smitelli.com)\n\nInstallation and Requirements\n-----------------------------\n\ntwitstash requires a PHP 5.3 installation with the following extensions\ninstalled:\n\n*   `curl` - Required by the `twitteroauth` library for making HTTP requests\n*   `bcmath` - Deals with Twitter's 64-bit IDs represented as strings\n*   `pdo` - Provides a database interface\n*   `pdo-mysql` - PDO driver for MySQL\n\nAdditionally, a working MySQL installation will be needed. Any recent version\nwill work. (I personally had issues inserting emoji characters on MySQL 5.1.51,\nbut I didn't pursue it too far. If you encounter a similar problem, an easy hack\nis to set the `text` column to `VARBINARY(140)` instead of `VARCHAR(140)`.)\n\n### To install:\n\n1.  `git clone --recursive https://github.com/smitelli/twitstash.git \u0026\u0026 cd twitstash`\n\n2.  Ensure you have an empty database created for the stored tweets, and that\n    there is a user account that can update this database.\n\n3.  `mysql --user=YOUR_USER --password YOUR_DATABASE \u003c twitstash.sql`\n\n4.  `cp config.ini-sample config.ini`\n\n5.  Edit `config.ini` to suit your fancy. You'll have to put your own Twitter\n    and MySQL authentication in there.\n\n6.  `chmod a+x twitstash.sh`\n\n7.  `./twitstash.sh`\n\nOn the initial run, twitstash will incrementally download older and older tweets\nuntil Twitter stops providing them. At the time of this writing, the most recent\n3,200 tweets can be retrieved. After the initial run, twitstash will stop making\nAPI requests once it encounters a tweet that it has previously stored.\n\nThe shell script is designed to never output anything, so you can add it in a\ncron job without worrying about spamming root's inbox with junk. A file called\n`debug.log` will be created (and appended) by the shell script. There's\ngenerally nothing useful in that file.\n\nStorage Format\n--------------\n\nData collected by twitstash is kept in three tables. The following is a list of\ncolumns and what types of data you can expect in each:\n\n### tweets\n\n*   `id` - Twitter's ID number for this tweet.\n*   `created_at` - The date and time this tweet was created. This time is stored\n    relative to the `timezone` setting in config.ini.\n*   `text` - The raw text of this tweet. There may be t.co URLs in here -- the\n    expanded URL is stored in the `urls.expanded_url` column.\n*   `source` - The URL and name of the client that created this tweet, typically\n    expressed as an HTML anchor tag.\n*   `reply_id` - The ID number of the tweet that this tweet is replying to. 0 if\n    this tweet is not a reply.\n*   `rt_id` - The ID number of the tweet that was retweeted. 0 if this tweet is\n    not a retweet.\n*   `place_id` - A 16-digit hex string identifying the \"place\" associated with\n    this tweet. JOINing this column on `places.id` will return a lot more info.\n    Also see \u003chttps://dev.twitter.com/docs/api/1.1/get/geo/id/%3Aplace_id\u003e\n*   `latitude` - The exact point latitude reported by the client. North is\n    positive, south is negative. 0 if this tweet had no geo data.\n*   `longitude` - The exact point longitude reported by the client. East is\n    positive, west is negative. 0 if this tweet had no geo data.\n*   `touched` - Used internally to determine if any tweets have \"disappeared\"\n    and should be marked as deleted. Always 0, unless the script died mid-run.\n*   `deleted` - **Estimated** date/time a tweet was deleted. The more frequently\n    twitstash is run, the more accurate this column becomes. NULL if this tweet\n    was never deleted (or, at least, it was not deleted when we last checked).\n\n### places\n\n*   `id` - A 16-digit hex string identifying this place.\n*   `place_type` - One of 'city', 'neighborhood', or 'admin'. There may be more.\n*   `full_name` - The full text name of this place.\n*   `country` - The full text name of the country that contains this place.\n*   `centroid_lat` - Latitude, averaging all points of the bounding box.\n*   `centroid_lon` - Longitude, averaging all points of the bounding box.\n\nSee `tweets.latitude` and `tweets.longitude` for info on the exact format of the\nlatitude/longitude pairs.\n\n### urls\n\n*   `url` - The shortened t.co link present in a tweet's text.\n*   `expanded_url` - The URL that the shortened link points to.\n\nAcknowledgements\n----------------\n\nThis package includes Abraham Williams' `twitteroauth` library.\n\u003chttps://github.com/abraham/twitteroauth\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmitelli%2Ftwitstash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmitelli%2Ftwitstash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmitelli%2Ftwitstash/lists"}