Personal API project for websites to display domain.com/api to show information about the site owner.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
index.php
php-example.php

README.md

personal-api

What It Does

Provides a simple JSON API for your personal site. Easily hosted on Heroku. Can provide any info you want, like age, employer, name, children, spoken languages, programming languages, skills, hobbies, or pretty much anything.

Idea

I saw Joshua Beckman's personal API and wanted to provide one that anyone can easily install, ideally somewhere like Heroku.

Setup

This runs really nicely on heroku, so I suggest running it there. To run anywhere else, just upload index.php and that's it. To setup Heroku, see this list.

  1. Fork tlongren/personal-api on GitHub and make a local clone.
  2. Install the Heroku Toolbelt and login to Heroku with the command heroku login. Enter your username and password to login with the Heroku Toolbelt.
  3. Create a new app on Heroku either through the web interface, or with the command heroku create. If you do it with the command line the app name will be shown to you,
  4. Open a terminal and go into the folder that you cloned your fork into and run the command heroku git:remote -a heroku-app-name. That will add a remote named "heroku" to your local clone.
  5. Now, while still in your local clone folder, run git push heroku master to push your app to Heroku. If your app is named "heroku-app-name", you can access your app at http://heroku-app-name.herokuapp.com.

Examples

PHP Example

For PHP devs, there's some basic querying examples in php-examples.php. Below is the output of php-example.php.

30
Array
(
    [0] => Javascript
    [1] => HTML
    [2] => CSS
    [3] => PHP
)
stdClass Object
(
    [wife] => Kayla
    [daughter] => Sydney
)

Other Language Example

I'll be adding examples for JavaScript and maybe other languages as well. If you really want to see examples for a language, open an issue. I just ask that you name your example files like so: ruby-example.rb for Ruby or python-example.py for Python.

A Screenshot

api.longren.org output