Click here to Skip to main content
15,896,278 members
Articles / Programming Languages / VBScript

Classic ASP and Facebook Graph API

Rate me:
Please Sign up or sign in to vote.
5.00/5 (12 votes)
10 Apr 2012CDDL4 min read 144.7K   3.2K   22  
Building on a previous article, we now delve into the Facebook Graph API and provide a few useful functions.
<% Option Explicit %>
<script language="javascript" runat="server" src="json2.asp"></script>
<!-- #INCLUDE FILE="fb_app.asp" -->
<!-- #INCLUDE FILE="fb_graph_api_app.asp" -->

<%
list_test

function list_test
    dim obj
    dim itm
    dim ix
    
    set obj = new List
    
    set  itm = new DataObject
    itm.key = "Item1"
    itm.item = "ABCDEFG"
    obj.Add(itm)
    
    
    set  itm = new DataObject
    itm.key = "Item2"
    itm.item = "HIJKLMN"
    obj.Add(itm)
    
    set  itm = new DataObject
    itm.key = "Item2"
    itm.item = "OPQRSTU"
    obj.Add(itm)


    set  itm = new DataObject
    itm.key = "Item4"
    itm.item = "WXYZ"
    obj.Add(itm)


    for ix = 0 to 3
        WriteBR( ix & " " & obj(ix).item )
    next

    
end function


class DataObject
    dim m_key
    dim m_item
    
    sub Class_Initialize()
        m_key = ""
        m_item = ""
    end sub
    
    property get key()
        key = m_key
    end property
    
    property let key(value)
        m_key = value
    end property
    
    property get item()
        item = m_item
    end property
    
    property let item(value)
        m_item = value
    end property
    
end class

function WriteBR( str )
    response.write str
    response.write "<br/>"
end function



%>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
Software Developer (Senior)
United States United States
I've been in development since the late eighties. Although I've picked up many languages over the years and will likely pick up many more I have been a Microsoft BASIC programmer the whole time. Back in the early days it was on a Color Computer 3 writing articles for an enthusiast's magazine and developing solutions for color computer users. Now it is C#, VB.NET and (still) VBScript with all the fixins (ADO,XML,JSON,SQL etc...). Around 1996 I decided the internet was the way to go and dedicated myself to web development. I've been doing it ever since.

Two of my favorite projects are working for a little company called Nigrelli Systems and working with a team of brilliant Engineers to develop fully automated packaging systems for the food and beverage industry. The second is working on a "Burn Room" Nemschoff Chairs, again I was blessed with a team of people who knew their stuff. The burn room remains unique to this day because there are only a handfull of certified rooms in the US.

Bears, Beats, Battlestar Galactica

Comments and Discussions