Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    Informational    Forum Updates  ›  Member API
Users Browsing Forum
No Members and 11 Guests

Member API  This thread currently has 1,159 views. Print
1 Pages 1 Recommend Thread
Justin
January 14, 2007, 2:41pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,017
Gender: Male
Posts Per Day: 6.74
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 18 hours
Location: Tallassee, AL
Age: 21
There's been a few requests for a Member API for external applications to see member information and all.  I've finally built it.

It uses Session ID's, so you MUST have it installed and working, and the users must be logged in with SIDs.  I've enabled SID-only login available here since it was implemented basically.  It's more secure, and it's better to use.

That out the way, here's how to use it.  It's simple, all you must do is pass the sid to the script via HTTP and it'll return the entire member data (except for password and admin passcode).  You may also use it by doing a require('API.pl') in any other Perl script, then by calling the actual routines.

HTTP Method
API.pl?sid-sessionid/ This information can be found in the users cookie (cookieprefix_session).  Let the external application get this cookie, and then call the script and it'll return a list of values, like so:

Code
<?xml version="1.0" encoding="ISO-8859-1"?>
<user>
 <id>admin</id>
 <snurl><a href="v-memberpanel/a-view/u-admin/" rel="nofollow" onclick="target='_parent';">admin</a></snurl>
 <lastvisit>1169526813</lastvisit>
 <rndsid>-260239|1169577389</rndsid>
 <lastactive>1169577389</lastactive>
 <option2></option2>
 <pmnew>0</pmnew>
 <msn>msn</msn>
 <email>justin@eblah.com</email>
 <option1></option1>
 <posts>87</posts>
 <lng>Romanian</lng>
 <personaltxt>Personal Message</personaltxt>
 <registered>1093208407</registered>
 <location>&lt;script&gt;asdf</location>
 <timezone>-6</timezone>
 <dateformat>F j, Y, g:ia</dateformat>
 <dob>4/25/1986</dob>
 <skype>skype</skype>
 <siteurl>http://www.site.com</siteurl>
 <sn>admin</sn>
 <md5upgrade>1</md5upgrade>
 <sitename>Sitename</sitename>
 <admintxt>Admin Text &amp;</admintxt>
 <avatar>Green_Monster.gif</avatar>
 <yim>yahoo</yim>
 <pmcnt>450</pmcnt>
 <lastpost>1168494636</lastpost>
 <icq>icq</icq>
 <blockedusers>1X|</blockedusers>
 <sex>1</sex>
 <aim>aim</aim>
 <sig>Sergio Tinè</sig>
 <avatarsize>65|50</avatarsize>
 <lastpm>1166911982</lastpm>
</user>


The external application can then decode this information by splitting the first from the second (: ).  The first being the variable, the second being the value of it.  Not too difficult.  It'll be split by a \n, or a new line.  It should be pretty easy to code in PHP or anything else.

require('API.pl')
This is the same as E-Blah's methods, just call the routine.  Get the userid (which is then added to variable $username) by passing the SID to the GetUserID routine, example:

Code
GetUserID(SID);


Then the $username variable will have the userid.  You can then run the GetMemberID routine, which will get the data you need from the user's data file, example:

Code
GetMemberID($username);


Then you'll have a hash reference of the data, which can be accessed in this manner:

Code
$memberid{$username}{'userid_variablename'}


So if you wanted the user's sn, do:

Code
$memberid{$username}{'sn'}


In the same way, you can get other MemberID's through this method.  It should be straight forward to just about anyone with a little knowledge of Perl, it's nothing big.  

Enjoy!





I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV


Revision History (5 edits; 3 reasons shown)
Justin  -  March 4, 2008, 2:24am
Justin  -  March 4, 2008, 2:08am
Justin  -  January 23, 2007, 12:50pm
Logged Offline
Site Site Private Message Private message
Mike Brazier
January 15, 2007, 12:16pm Report to Moderator Report to Moderator

E-Blah Member
Posts: 60
Gender: Male
Posts Per Day: 0.06
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 2 days 8 hours 36 minutes
Location: Birmingham
Age: 33
Thanks Justin, I will install 10.2 on my test server and have a mess around.
I assumed you weren't going to bother with this, thanks for doing this.

Mike.
Logged Offline
Site Site Private Message Private message Reply: 1 - 7
Justin
January 23, 2007, 12:57pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,017
Gender: Male
Posts Per Day: 6.74
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 18 hours
Location: Tallassee, AL
Age: 21
The API has been re-released under the Downloads page.

http://www.eblah.com/downloads.php

The new API uses XML for the return instead of the way it used to be (if calling from HTTP).  Enjoy!  


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 2 - 7
goober99
June 15, 2007, 2:22pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 8
Posts Per Day: 0.01
Time Online: 4 hours 57 minutes
Does this also work for E-Blah SQL?
Logged Offline
Private Message Private message Reply: 3 - 7
Justin
June 15, 2007, 4:36pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,017
Gender: Male
Posts Per Day: 6.74
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 18 hours
Location: Tallassee, AL
Age: 21
No.


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 4 - 7
goober99
June 15, 2007, 8:38pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 8
Posts Per Day: 0.01
Time Online: 4 hours 57 minutes
I'm planning on writing a web application that integrates with the E-Blah Member system, so visitors to my website don't have to have a separate user name/password for the different parts of the site. I guess my question should have been, "If E-Blah SQL does not currently support the Member API (obviously no), do you plan for it to in the future?"
Logged Offline
Private Message Private message Reply: 5 - 7
Justin
June 15, 2007, 8:52pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,017
Gender: Male
Posts Per Day: 6.74
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 18 hours
Location: Tallassee, AL
Age: 21
Not right now, partly because I'm too busy, the other reason because you have a full access to the MySQL database, so it shouldn't be too difficult to figure it out that way.


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 6 - 7
JonathanW
September 6, 2008, 7:12am Report to Moderator Report to Moderator
E-Blah Member
Posts: 1
Posts Per Day: 0.50
Time Online: 22 minutes
Hello

This looks great. However, I have never written anything in Perl and am struggling with how to use it. I can program in other languages (C++,VB etc) but not Perl. Does anyone have an example of this in use that they could post which would get me started. As background information, we use E-Blah on our church website and would like to add a files page to the website, but only want people to be able to download the file if they are logged on. The files we want to host are MP3 recordings of the service. I have tried including them in a post, but the post is becoming too long and it would be much better in a web page.

Please help me if you can.

Thanks

Jonathan
Logged Offline
Private Message Private message Reply: 7 - 7
1 Pages 1 Recommend Thread
Print

E-Blah Community    Informational    Forum Updates  ›  Member API

Thread Tags
E-Blah,  API