-1

I am trying to utilize a library i found on github

https://github.com/dannyrich/CFVimeoAPIWrapper

Here is my init code

        CLIENT_ID = "the id string";
        CLIENT_SECRET = "the secret string";
        ACCESS_TOKEN = "token";
        ACCESS_TOKEN_SECRET = "token secret";
        PER_PAGE = 10;
        vimeo = createObject("component", "models.vimeoService").init(CLIENT_ID, CLIENT_SECRET);
    //error occurs here
        vimeo.setToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
    data = vimeo.call( "vimeo.albums.getVideos", 
  { 
    "album_id"="1682859", 
    "full_response"="Y",
    "sort"="date", 
    "page"="1", 
    "per_page"=PER_PAGE 
  }

and I am getting the following error

Variable VIMEO is undefined.

not sure why exactly I am getting this, i mean even with the compnent being created it should define the variable

i know its a stretch, but any help on this at all would be greatly appreciated

Jay Rizzi
  • 4,196
  • 5
  • 42
  • 71
  • No, because that particular `init()` function is a bit atypical and returns `void`, rather than the component itself. So the captured result becomes null or undefined. Take another look at the example on the GitHub page. It creates an instance, but does *not* capture the result of init(). – Leigh Nov 29 '16 at 21:49
  • youre right, that got me further along for sure, thank you for your help, make it an answer and ill accept – Jay Rizzi Nov 30 '16 at 16:26

1 Answers1

1

<cffunction name="init" access="public" returntype="void">

No, because that particular init() function is a bit atypical, in that it returns void instead of an object. So the captured result becomes null or undefined.

Take another look at the example on the GitHub page. It creates an instance, but does not capture the result of init():

<cfset vimeo = createObject("component", "VimeoComponent")>
<cfset vimeo.init(CLIENT_ID, CLIENT_SECRET)>
Leigh
  • 28,765
  • 10
  • 55
  • 103