where can i find documents on the widgetbox javascript API?
Overheard
from a Twitter post by
gabrielinux
@widgetbox Where are the widgetbox javascript API documents? Can't seem to find them anywhere....
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?Hey Gabriel,
If you're referring to the hooks that we have for making Javascript widgets, you should be able to find what you need here:
http://docs.widgetbox.com/developers/...
Hope this helps! -Dave
I’m confident
-
Inappropriate?I think the question is more like where one can find documentation of the functions in the WIDGETBOX.* namespace (like the one used in the "Proxied request" snippet). At least, that's what I'm trying to figure out...
-
Inappropriate?In the code editor, if I choose "Proxy Request" from the "Snippets" menu, this code gets pasted in:
<script type="text/javascript">
var req = new WIDGETBOX.net.ProxiedHTTPRequest();
req.onload = function() {
//Your code goes here... use req.responseText for response
}
req.open("get", "http://remote.url.goes.here/");
req.send();
</script>
What I'm looking for is some documentation that helps me understand what exactly is going on here. It's clear that there is some set of Javascript functions that are accessible via the WIDGETBOX.* namespace, but it's not clear what those functions are, what they return, or how to work with them. The sample code shows that WIDGETBOX.net.ProxiedHTTPRequest() returns an object with methods "open" and "send", but it's not clear what arguments I can pass these methods or what exactly they return.
I don't see any documentation addressing these issues on the page you linked to, which is more of a high-level overview of how HTML/JS widgets work than API documentation. So should I just assume these functions are undocumented for the time being? Or am I missing a link somewhere?
I’m confused
-
Inappropriate?I have the same question. I am trying to make a we feel fine! widget, and the "normal" API call doesn't seem to work.
-
Inappropriate?Hey Jason and Nynke,
We don't have a doc on the web services proxy yet (anymore), but we're going to put on together. The previous doc was 'lost in the fire' when the old forums went away.
This doc will only be around the web services proxy, however. The majority of the widgetbox. namespace is a private API, not a public API.
-
Inappropriate?Thank you. That will work for me. Maybe an example of it's use, so I can "translate" for my purpose? Like a man page?
-
Sure thing. Once it's up, it will be a doc explaining simple usage. -
Inappropriate?When do you think it will be available? Around ...
-
Inappropriate?Sorry, Nynke, I don't have an ETA. Could be a few days, could be more. It really depends on when we get time to put it together.
-
Inappropriate?You are funny! That's wayyyy closer than I thought. I was thinking in terms of "how many weeks" ... I was considering maybe moving to create a google gadget and then import it, or somin like that. Now I do not have to. Thank you!
I’m excited
-
Inappropriate?Jason Lefkowitz' question was ten months ago, hence ...
-
Inappropriate?Yeah, I think I actually spoke with Jason over e-mail around the same time, but I could be mistaken.
Plus, you would have been pretty bummed when you imported a google gadget only to find that you can't use their libraries, including the one that proxies requests.
In the meantime, if you want to post how you're hoping to use the proxy, we can make sure that our info addresses that implementation.
-
Inappropriate?Ok, but please keep in mind that I am still learning ... and may have taken on a bit too much? As usual ... hey, but maybe you can help (I am getting some free support here maybe! :)
------------
I am wanting to make a "we feel fine" widget that's sizable, and just has the "we feel fine" link. No big screaming logoos from me. Just a link to "We feel fine" to honor the creative commons license. And as formattable by users as possible. I am wanting to offer all the options listed here:
http://www.wefeelfine.org/api.html
Plus "color" (text, background), "edges" (color, round or not) and "sizing" from a mini-widget to a page size version.
But my first story is that I actually want to be able to produce the data, of course.
------------
<style type="text/css">
.title {font-family: Georgia,"Times New Roman",Times,serif;font-size: 18px;font-style: italic;line-height: 20px;color: #003300; text-align:center;}
</style>
<h1 class="title">We Feel Fine</h1>
";
} else {
return "
";
}
}
var today = new Date();
var y = today.getUTCFullYear();
var m = today.getMonth() + 1;
var d = today.getDate();
var today_str = y + ((m < 10) ? "-0" : "-") + m + ((d<10><![CDATA[
var req = new WIDGETBOX.net.ProxiedHTTPRequest();
req.onload = function() {
/* puzzle, puzzle */
if (req.response == null || typeof(req.response) != "object" ||
response == null) {
ummmmmmmmmmmm = "<i>Invalid data.</i>";
return;
}
}
req.open("get", url);
req.send();
//]>
var one = false;
var html = "<table>";
var feelings = response.split("\n");
var t = 0;
for (var i = 0; i < feelings.length; i++) {
var f = feelings[i];
var attrs = f.split("\t");
if (attrs.length != 7) { continue; }
var attr_posturl = attrs[0];
var attr_imageid = attrs[1];
var attr_feeling = attrs[2];
var attr_postdate = attrs[3];
var attr_posttime = attrs[4];
var attr_sentence = attrs[5];
if (attr_posttime == "" || attr_imageid == "" ) { continue; }
t++;
if (t > 7) { continue; }
var now = new Date().getTime();
var minutes = (now - attr_posttime) % 60 ;
var time_str = minutes + " minute"+((minutes != 1) ? "s" : "")+" ago";
html += "<tr><td>
I’m amusing myself, and silly of course
-
This reply was removed on 08/18/09.
see the change log -
Inappropriate?Hi Nynke,
I think I can help get you started with a simple example.
The Proxy Request snippet is a skeleton for a simple AJAX call. It looks much like AJAX wrappers provided by other libraries such as Prototype.js - the difference is that our AJAX wrapper Proxy Request sends the request through a Widgetbox proxy web service to overcome some security obstacles with cross-domain scripting and make sure widgets don't execute malicious code.
Here is a simple example of the snippet, fleshed out a little to get the latest sentence from We Feel Fine, and then update the DIV tag with the content.
http://j.otdown.com/jot/7f2
If you want to get more than one sentence or use the XML format you can change the query string parameters and then do some initial processing in the req.onload callback function (which gets executed after req.send() completes).
I hope this is enough to get you started,
Jeff -
Inappropriate?Thank you very much. A start. Was the interface or snippet tested? It is for one sentence, the latest, and I get none?
-
Inappropriate?Hi there,
You can see a working version of the widget here:
http://www.widgetbox.com/widget/we-fe...
And here is the exact code from the widget:
http://j.otdown.com/jot/7f2
Make sure when editing your widget's javascript that you don't run into any syntax errors using the studio editor. Some useful javascript debugging extensions for Firefox include Firebug and Web Developer.
Hope this helps,
Jeff -
Inappropriate?Well, I copied it exactly. How many syntax errors can one make with a "copy paste". No dice. I am giving up. Thanks anyway.
-
Inappropriate?Hi Nynke,
Codepress - the syntax highlighting plugin in the editor - may inadvertantly convert some double spaces after javascript statements to non-breaking spaces. That's where the javascript syntax errors can occur.
We're looking into either fixing that problem or allowing for the syntax highlighting to be disabled. It's only an issue when copying from the editor to another text field or text editor - it's an issue pretty much isolated to sharing code from the studio editor.
If you would like to give me the link to your widget I can go in and make sure that's not an issue.
I've also updated the source I shared with you earlier to ensure that double spaces won't get converted to non-breaking spaces:
http://j.otdown.com/jot/7f2
Thanks,
Jeff -
Inappropriate?Checked for those and now I've got it working. Thanks a million! Now I can wrap my code around and get creative with displaying. Soon, soon, soon, (2 days or so) I will post a link here so you can enjoy too what you helped create. And I'll be writing a blog on the excellent support of widgetbox.
I’m Excited and entirely happy
-
Inappropriate?This is awesome!
Just what I was looking for and needed. If I can pile on here, I will be adding in a feed dynamically via a param when the user get the widget to customize is there an example to style the feed elements? I have a piece of javascript but I am not sure how to use it in this setting. Since the snippet you described gets the feed, I am not sure how to use my function now:
I’m happy
You'll have to tweak the javascript to read your feed, but the example on this page works:
http://docs.widgetbox.com/developers/...Inappropriate?Hi Dave,
I have code that I wrote for this purpose, I am just not sure how to paste in here to have someone aide me in getting it all worked out.
I’m happy
Inappropriate?Hi Dave,
I have code that I wrote for this purpose, I am just not sure how to paste in here to have someone aide me in getting it all worked out.
I’m happy
We don't do code consulting. If you have a problem related to the platform (e.g. Widgetbox related), I can help some, but getting the code to work independently of Widgetbox is on you. Hope you understand, but if we had to support everyone in writing their actual code, we'd be out of business.
So get your code working on another page, then try bringing it into Widgetbox and we may be able to help.Inappropriate?it does work on another page.. I am trying to port it over:
Working example: Just input a rss feed:
Working Example
the javascript in the example works fine I just can't figure out how to put my function in the widget box and have it be called properly
Good stuff, Ray. Can you also post a link to where in Widgetbox you started to pull this in?Inappropriate?Sure thing.. I am all about helping..
Do you mean all of the locations I got this from?
Just the widget's page on our site. widgetbox.com/widget/________Inappropriate?Ahh..
I don't have a working one yet... the function to parse out the feeds is where I am having the trouble porting... I wanted to post it into this thread to see if someone could help me troubleshoot it... but I don't know how to put code in the replies here... I try the code brackets but no luckInappropriate?Hi Dave,
I have code that I wrote for this purpose, I am just not sure how to paste in here to have someone aide me in getting it all worked out.Inappropriate?Hi Dave,
I have code that I wrote for this purpose, I am just not sure how to paste in here to have someone aide me in getting it all worked out.
I’m happy
not really asking you persay to code but asking the community to help me tweak this so we can all benefit from it
Post up your Widgetbox username and I'll see if we can find the widget that you've started coding.Inappropriate?my Developer name is Honeymoon Registry.... Is that what you need/mean?
I'll actually need your username, as in the username that you login to Widgetbox with.
Ray,
I'm heading out of town for a wedding tonight, but I'll see if someone else can take a look at this for you.Inappropriate?Thanks.. funny thing is that it was working.. then it reverted back... I was soooo pissed cause I was trying different things and have no idea how I got it to work
I’m frustrated
Inappropriate?Have fun... make sure you do the cha cha slide a few times =)
Loading Profile...





EMPLOYEE