Categories: Development

How to tweet out your latest Fortnite game result with Twitter api in php

Here is how to automatically with the twitter api and a cron job tweet out if you finished 1st, top 5 or top 10 in your last Fortnite game along with how many kills you got.

If you don’t already have a webserver i highly recommend Vultr you can get a $5 windows server by following this guide. Here is a guide to setting up XAMPP on your windows server too.

Once you have your server with XAMPP drop the files from fortnite tweeter into C:\xampp\htdocs

You now need to make some changes, I recommend using a simple editor like notepad++ for this.

Open functions.php and on line 5 and 7 you need to add your Twitter account api/access keys see this post on how to get them.

Lastly you need a Fortnite tracker api key go here to get it and replace all: *FORTNITE-TRACKER-API-KEY* instances with your api key. Save functions.php

Rename get.php to something less common like (orangejuice.php) In this file you will see the 3 main calls, you need to put in your Fortnite username instead of FORTNITE-NAME

NOTE If you dont play on pc in functions.php change all instances of /pc/ to /xbl/ or /psn/

Create an account at Cron-job.org and go to create cronjob.

Fill out the cron job by calling it Fortnite tweeter and use your server ip and php file like http://serverip/phpfile.php

Schedule it for 15 minutes intervals like the image below:

Click the Create cronjob button.

Now every 15 minute the cronjob will fire and check if you have played a Fortnite game since it last checked. If yes and you got 1st, top 5 or top 10 it will Tweet an example like “I just won a solo Fortnite Battle Royale game with 12 kills!” With it getting and comparing your kills to find out how many kills you got in that match.

Check the functions.php for changing the tweet message….tweet();

 

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago