Skip to content
Snippets Groups Projects
Unverified Commit a1e57b41 authored by Robb Lewis's avatar Robb Lewis
Browse files

Setup

parent 78cb46e5
No related branches found
No related tags found
No related merge requests found
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_ENV=production
APP_DEBUG=false
 
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_DATABASE=one40
DB_USERNAME=
DB_PASSWORD=
 
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
PRIVATE=false
TWITTER_USERNAME=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=
 
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
SESSION_DRIVER=cookie
\ No newline at end of file
# One40 — Personal Twitter Archive
# One40 — Self Hosted Twitter Archive
 
test
one40.me
## Inital Setup
 
1. `cp .env.example .env`
2. Set `DB_DATABASE`
3. Create database
4. Run `php artisan one40:setup`
php artisan vendor:publish
Clone this repository `git clone https://github.com/rmlewisuk/one40.git one40` and navigate to the root `cd one40`. Run `composer install` and then create a copy of the example env file `cp .env.example .env`. Open `.env`, fill in your database details. Then go to [https://apps.twitter.com](https://apps.twitter.com) and create a new application to get your app keys, and fill put them in the env file. Finally, set `PRIVATE` to true if you don't want your Twitter archive to be publicly accessible (we'll create a user account in the next step). Finally, run `php artisan key:generate`.
 
## User account
 
- Authorisation/setup
- Process Tweet
- Importing archive
- Fetching new tweets
Run `php artisan one40:setup`; this will setup the database and prompt for a username and password. This user account is used to login to one40 to see fetch logs and limit access to your archive (if the app is set to private).
 
## Importing your archive
 
- Input keys
- Authorise with Twitter
- Setup DB
- Admin password setup
- Setup
- Remove setup.php
- Load user
- Load tweets
\ No newline at end of file
NB: You can request your [Twitter archive here](https://support.twitter.com/articles/20170160)
To import your archive, move all the `(data/js/tweets/year_month.js)` files to `resources/archive` and run `php artisan one40:import`. This can take a while depending on the size of your archive, so if it times out, just rerun it — one40 keeps track of which files it has imported, so it won't re-run the same archive file twice.
## Fetching new tweets
You can fetch new tweets by running `php artisan one40:fetch`. This will import your most recent tweets (up to 3200) so it's best to import a recent archive first. It's recommended you setup a cron job to fetch new tweets on a schedule (although you can do it manually if you want). To fetch new tweets at midday every day, add this to your crontab:
1 12 * * * php /path/to/your/project/artisan one40:fetch
[This article](https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-on-a-vps) explains how to setup cron jobs.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment