Latest Update: 05/25/05 01:24am Ver API_VERSION

With this API you can add e:strip content from your journal to your own website and design the website however you want. You can then update your journal at e:strip and your site will update accordingly. Using the e:strip API is easy! Simply follow the instructions below to get you started. An example page named test.php can be downloaded below. You can also view a live copy of the example page here.

instructions:


1. Download the api zip file

2. Unzip the file you downloaded and upload the contents to a folder on your PHP enabled server.

3. At the top of any web page that you want to display estrip content from your journal, you must include the following code, make sure to change your_username_in_lowercase to your estrip username.

<?php
//this is the file that gets the journal, if you move it outside of this folder you must change the path!!!
include('estrip_express.php');

//tells php to begin to grab a new journal - make sure to change this line to point to the site your journal is on
$journal = new journal("http://www.elmwoodstrip.com/elmwood");

other examples include "http://www.estripwest.com/west", "http://www.epeers.net/dma201", "http://www.epeers.net/dma390", "http://www.epeers.net/dma408b"


//sets your user_name
$journal->user_name = "
your_username_in_lowercase";

//gets your stats -> you do not need this if you dont want the stats( e.g. you want only the journal)
$stats = $journal->get_stats();

//$profile = $journal->profile(); //remove the two "//" from the beginning of this line if you want to api to fetch your profile also.

//$user_pic = $journal->user_pic(); //remove the two "//" from the beginning of this line if you want to api to fetch your user_pic also.

//gets you journal-> you do not need this if you dont want the journal (e.g. you want only the stats). You can use any of these three methods but only need one.

$blog = $journal->fetch(); //fetches last 10
$blog = $journal->fetch("701"); //fetches a specific blog
$blog = $journal->fetch("701-720"); //fetches a series of blogs

//gets titles as list with id for figuring out which is which
$titles = $journal->show_titles();

//gets fav five list as links
$fav = $journal->get_fav();

?>

4. After that you can begin to code your web page as your would any webpage. The current API returns your latest 10 entries (listed as 0-9) plus you user stats. To include estrip info use the following codes anywhere in your HTML document.

CODES:



Journal Entry Include Statements:
Journal 0 is you most recent journal. Simply change the number 0 in the following code to any other number between 0-9 in order to print a another journal. Journal 1 is your next most recent journal, and so forth.

prints titles of journals loaded
<? print $titles; ?>

prints id for journal 0 title
<? print $blog['id']['0']; ?>

prints title for journal 0 title
<? print $blog['title']['0']; ?>

prints entry for journal 0 title
<? print $blog['entry']['0']; ?>

prints date for journal 0 title
<? print $blog['date']['0']; ?>

prints time for journal 0 title
<? print $blog['time']['0']; ?>

prints link for journal 0 title
<? print $blog['link']['0']; ?>



user stats include statements:

prints the total words
<? print $stats['total_words']; ?>

prints the total entries
<? print $stats['total_entries']; ?>

prints the total sounds
<? print $stats['total_sounds']; ?>

prints the total images
<? print $stats['total_images']; ?>

prints the total SWFs
<? print $stats['total_swf']; ?>

prints the number of views for the user's journal
<? print $stats['views']; ?>

prints the last time the user was online at the site
<? print $stats['last_online']; ?>



PROFILE include statements:
prints the users about_me from profile
<? print $profile; ?>


USERPIC include statements:
prints the users user_pic from the site
<img src="<? print $profile; ?>" />



FAV 5 list include statements:
prints the the fav list as links
<? print $fav['list']; ?>

prints only a specific fav five link labeled 0-4
<? print $fav['0']; ?>


ADVANCED USAGE:

ADDING MORE ENTRIES

<?
//selecting another set of journals on the same page
$other_entries = $journal->fetch(701-710); //fetches journals 701-710
$other_titles = $journal->show_titles();
print $other_titles; //prints the title links to journls 701-710
?>

ADDING OTHER USERS JOURNALS AND STATS:
You can add info from more than one journal to the page

<?
//instantiates a new journal
$second_journal = new journal; //grabs another journal, best to name it after the user

//sets the user_name
$second_journal->user_name = "paul";//<-- CHANGE TO USERNAME DESIRED //

//gets user's stats -> you do not need this if you dont want the stats
$second_journal_stats = $second_journal->get_stats();

//gets you journal-> you do not need this if you dont want the journal (e.g. you want only the stats)
$second_journal_blogs = $second_journal->fetch();

//gets the user titles for fetched entries and prints a list with links
$second_journal_titles = $second_journal->show_titles();

//get the user's about_me paragraph from their profile
$second_journal_profile = $second_journal->profile();

//get the user's about_me paragraph from their profile
$second_journal_user_pic = $second_journal->user_pic();

?>

Note: after this use the same print commands as above but make sure to use the $seocnd_journal variable instead. This could work for multiple other jorunals as well.