<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4767653015949736449</id><updated>2012-02-15T22:34:19.022-08:00</updated><category term='C#'/><category term='Access'/><category term='Feed'/><category term='Javascript'/><category term='Database'/><category term='Calendar'/><category term='Flickr'/><category term='YQL'/><category term='White Pages'/><category term='yql json yahoo US Dropdownlist'/><category term='CSharp'/><category term='yql json yahoo feed'/><category term='Jquery'/><category term='JSON'/><category term='VB'/><category term='API'/><category term='Google'/><category term='ASP.NET'/><title type='text'>Joshua Blackstone</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-1076472928355355368</id><published>2011-12-01T10:50:00.001-08:00</published><updated>2011-12-01T11:44:03.070-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Jquery'/><title type='text'>Using JQuery ProgressBar with Long ASP.NET Process</title><content type='html'>OK, so maybe others have figured this out, but if so, they haven't written about it.  Wanted to use the JQuery Progressbar to display progress results for a long ASP.NET Process.  &lt;br /&gt;&lt;br /&gt;First thing was to download a theme from the ThemeRoller site, &lt;a href="http://jqueryui.com/themeroller/"&gt;http://jqueryui.com/themeroller/&lt;/a&gt;, and add the jquery library to my project.&lt;br /&gt;&lt;br /&gt;Next, you must create a class to process the status of a ThreadStart Result in ASP.NET.  For details on doing this, you can read the Microsoft Documentation, located at: &lt;a href="http://msdn.microsoft.com/en-us/library/ms978607#diforwc-ap02_plag_howtomultithread"&gt;&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;Next, you will need two pages, one for creating the long process, one for showing the progress of the item.  &lt;br /&gt;&lt;br /&gt;The majority of the work can be found in the sample code, found at: &lt;a href="http://www.joshuablackstone.com/Examples/LongProcess.zip"&gt;http://www.joshuablackstone.com/Examples/LongProcess.zip&lt;/a&gt;, but the key for me was how to show the progress in the progress bar.  First, create your div, such as:&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="progress" rel="0" runat="server" id="progressBar"&amp;gt;&amp;lt;/div&amp;gt;, and then the code to post the value to the progress bar is set with this function:&lt;br /&gt;&lt;br /&gt;function pageLoad(sender, args) {&lt;br /&gt;             if (args.get_isPartialLoad()) {&lt;br /&gt;                 $("div.progress").each(function () {&lt;br /&gt;                     var element = this;&lt;br /&gt;                     $(element).progressbar({&lt;br /&gt;                         value: parseInt($(element).attr("rel"))&lt;br /&gt;                     });&lt;br /&gt;                 });&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;The reason for the section (if (args.Get_isPartialLoad)) is because an update panel is triggering a timer every two seconds to get the latest value from the threadstart.  &lt;br /&gt;&lt;br /&gt;So then, you run the process, which sends the user to the progress page, where they will see a jquery themed progress bar showing progress for the long process, and redirects to a page of your choice when complete.&lt;br /&gt;&lt;br /&gt;Cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-1076472928355355368?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/1076472928355355368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2011/12/using-jquery-progressbar-with-long.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1076472928355355368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1076472928355355368'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2011/12/using-jquery-progressbar-with-long.html' title='Using JQuery ProgressBar with Long ASP.NET Process'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-8642686335268075327</id><published>2010-09-22T18:19:00.001-07:00</published><updated>2010-09-22T18:30:33.814-07:00</updated><title type='text'>JSON Fetch Random Record</title><content type='html'>Searched everywhere for this one.  Hopefully it will help someone else out...&lt;br /&gt;&lt;br /&gt;I was looking for a way to filter a JSON dataset by an ID number.  Here goes...&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Step 1 : Create your JSON Data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var item = [&lt;br /&gt;  { "id": "0", "language": "English"},&lt;br /&gt;  { "id": "1", "language": "Spanish"},&lt;br /&gt;  { "id": "2", "language": "French"},&lt;br /&gt;  { "id": "3", "language": "Hungarian"}&lt;br /&gt;];&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Step 2 : Function to find Unique Value:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I cant take credit for this one.  I found this at : &lt;a href="http://stackoverflow.com/questions/604935/how-can-i-filter-json-for-unique-key-name-value-pairs" target="_blank"&gt;http://stackoverflow.com/questions/604935/how-can-i-filter-json-for-unique-key-name-value-pairs&lt;/a&gt;.  Here it is...&lt;br /&gt;&lt;br /&gt;function getDistinct(o, attr) {&lt;br /&gt;    var answer = {};&lt;br /&gt;    $.each(o, function(index, record) {&lt;br /&gt;        answer[index[attr]] = answer[index[attr]] || [];&lt;br /&gt;        answer[index[attr]].push(record);&lt;br /&gt;    });&lt;br /&gt;    return answer;  &lt;br /&gt;}&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Step 3: Create Random Number&lt;br /&gt;&lt;br /&gt;var randNo = Math.floor(Math.random() * 4); (with 4 being the same number of records contained in the JSON Dataset).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Step 4: Return unique record items&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$(function() {&lt;br /&gt;    $.each(getDistinct(markers, &amp;quot;id&amp;quot;), function(groupName, recordArray) {&lt;br /&gt;        var firstRecord = recordArray[randNo];&lt;br /&gt;        $('&lt;li&gt;&lt;/li&gt;').html(firstRecord.language).appendTo('#results');&lt;br /&gt;    });&lt;br /&gt;});&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, the body simply contains an unordered list with an id of results to contain the information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-8642686335268075327?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/8642686335268075327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/09/json-fetch-random-record.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/8642686335268075327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/8642686335268075327'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/09/json-fetch-random-record.html' title='JSON Fetch Random Record'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-1178837871094757849</id><published>2010-09-17T06:04:00.001-07:00</published><updated>2010-09-17T06:06:34.489-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Routing 4.0 Handle Error</title><content type='html'>OK, so this took a lot of searching, but this worked.  Not sure why it isn't put into the Web.Config file initially, or that there isn't more documentation, as this had me going nuts.  Anyways, if you get a 404 error on the ASP.NET 4.0 routing feature when you deploy to IIS7.0, take a look at this.  I bet it will get you going...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gildnersolutions.com/post/2010/04/21/ASPNET-40-URL-problem-with-IIS7.aspx"&gt;http://www.gildnersolutions.com/post/2010/04/21/ASPNET-40-URL-problem-with-IIS7.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-1178837871094757849?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/1178837871094757849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/09/aspnet-routing-40-handle-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1178837871094757849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1178837871094757849'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/09/aspnet-routing-40-handle-error.html' title='ASP.NET Routing 4.0 Handle Error'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-537758217269983436</id><published>2010-07-13T08:51:00.000-07:00</published><updated>2010-07-13T08:58:34.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Jquery'/><title type='text'>Javascript In or Out of Office</title><content type='html'>Wanted to create a standard tool to determine if a business is in or out of the office.  Fairly standard stuff, but here it is if anyone can use it.&lt;br /&gt;&lt;br/ &gt;&lt;br /&gt;Needed to check for 3 things.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Holidays&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Weekends&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Business Hours (in this case 8 to 5)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Anyways, here's the script that results in a boolean value to determine whether or not the office is open.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var d = new Date();&lt;br /&gt;var day = d.getDay();&lt;br /&gt;var h = d.getHours();&lt;br /&gt;var y = d.getYear();&lt;br /&gt;&lt;br /&gt;var holidays = ['1/1/' + y,&lt;br /&gt;                '1/21/' + y,&lt;br /&gt;                '2/18/' + y,&lt;br /&gt;                '5/26/' + y,&lt;br /&gt;                '7/4/' + y,&lt;br /&gt;                '9/1/' + y,&lt;br /&gt;                '10/13/' + y,&lt;br /&gt;                '11/11/' + y,&lt;br /&gt;                '11/27/' + y,&lt;br /&gt;                '12/25/' + y,&lt;br /&gt;                '12/31/' + y];&lt;br /&gt;&lt;br /&gt;function isWeekend() {&lt;br /&gt;    if (day == 0 || day == 6) {&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;    else &lt;br /&gt;    {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function isOffHours() {&lt;br /&gt;    if (h &lt; 8 || h &gt; 17) {&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function businessClosed() {&lt;br /&gt;    var today = (d.getMonth() + 1) + '/' + d.getDate() + '/' + y;&lt;br /&gt;    if (isWeekend() == true || (jQuery.inArray(today, holidays)) &gt; 0 || isOffHours() == true) {&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$(function () {&lt;br /&gt;    if (businessClosed() == true) {&lt;br /&gt;        alert('Sorry, we are closed!');&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        alert('Open for Business!');&lt;br /&gt;    }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want to download, it can be found &lt;a href="http://www.joshuablackstone.com/Scripts/BusinessHours.js"&gt;HERE&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-537758217269983436?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/537758217269983436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/07/javascript-in-or-out-of-office.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/537758217269983436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/537758217269983436'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/07/javascript-in-or-out-of-office.html' title='Javascript In or Out of Office'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-4516842580132608005</id><published>2010-06-17T05:33:00.000-07:00</published><updated>2010-06-18T09:40:13.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='CSharp'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# vs VB - The debate continues...</title><content type='html'>Just getting my feet wet with C#, after being a VB developer for awhile, realizing that C# is getting all of the jobs.  With that being said, have run into a few difficulties in converting over, and I'll list a couple here, to be added to as I go along.  Consider this a newbie's version of headaches you may face when switching to C#...&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; In VB, if you want to locate an element inside of a control, you would use:&lt;br /&gt;&lt;br /&gt;Dim control as CONTROLTYPE = CType(CONTAINER.FindControl(&amp;quot;ControlID&amp;quot;), CONTROLTYPE)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In C#, you would write the same expression as:&lt;br /&gt;&lt;br /&gt;CONTROLTYPE control = (CONTROLTYPE)CONTAINER.FindControl(&amp;quot;ControlID&amp;quot;);&lt;br /&gt;&lt;br /&gt;&lt;li&gt; In VB, if you want to place an IIf statement inside of a Label Control, you're free to do so.  Simply use&lt;br /&gt;&lt;br /&gt; &amp;lt;%#IIf(Convert.ToString(EXPRESSION)=Something, True, False)%&amp;gt;&lt;br /&gt;&lt;br /&gt; However, when you attempt to use this in C#, you will get an error, as IIf isn't recognized.&lt;br /&gt;&lt;br /&gt;  Here's the fix: &lt;br /&gt;&lt;br /&gt;&amp;lt;%# (Convert.ToString(EXPRESSION) == Something ? True : False)%&amp;gt;.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Of Course, &amp; is not recognized, it is replaced by +.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I know when I was creating a VB Side HTML Message, or if I was creating a very long string, I would use  '&amp; vbCrLf _'. However, in C#, this changes a bit.  Declare your String, and append it just as you would in JS.  Example?&lt;br&gt;&lt;br&gt;&lt;br /&gt;string A = "";&lt;br /&gt;&lt;br /&gt;A += "This is a string ";&lt;br /&gt;A += " and the second line of the string...";&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;I will modify this as I go, but if you are like me, and have done VB this whole time, I would recommend taking any current sites you have done, and redo them from scratch in C#.  Get Hung Up?  Use &lt;a href="http://www.developerfusion.com/tools/convert/vb-to-csharp/"&gt;THIS&lt;/a&gt; as a last resort, it's a pretty good tool.&lt;br&gt;&lt;br&gt;&lt;br /&gt;Good Luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-4516842580132608005?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/4516842580132608005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/06/c-vs-vb-debate-continues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/4516842580132608005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/4516842580132608005'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/06/c-vs-vb-debate-continues.html' title='C# vs VB - The debate continues...'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-1416198863986939743</id><published>2010-06-09T11:51:00.000-07:00</published><updated>2010-06-09T11:53:22.629-07:00</updated><title type='text'>Thank You Ryan Grove - Finally a Script Loader that works painlessly!</title><content type='html'>Finally was able to make my homepage not CRAWL due to a lazy script loader that I found. Prior to this, either security was too tight from GoDaddy or it was just made for Image Files.  Anyways, check this out...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://wonko.com/post/painless_javascript_lazy_loading_with_lazyload'&gt;http://wonko.com/post/painless_javascript_lazy_loading_with_lazyload&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-1416198863986939743?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/1416198863986939743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/06/thank-you-ryan-grove-finally-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1416198863986939743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1416198863986939743'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/06/thank-you-ryan-grove-finally-script.html' title='Thank You Ryan Grove - Finally a Script Loader that works painlessly!'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-6251711853869160900</id><published>2010-06-08T10:24:00.000-07:00</published><updated>2010-06-08T10:33:21.553-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='Calendar'/><category scheme='http://www.blogger.com/atom/ns#' term='YQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Jquery'/><title type='text'>Use Google Calendar as Datasource for Holiday Notifications</title><content type='html'>I wanted to see how difficult it would be to do a simple notification on my site of any basic holidays that occurred on any given day.  Sure, it would be simple enough to simply create an array to hold the data in js, and display if the date matched, but I figured I would use a JSON Feed to display the data instead.  Turns out Google Calendar has just the thing in their Holiday Calendar Feed.&lt;br /&gt;&lt;br /&gt;http://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/basic&lt;br /&gt;&lt;br /&gt;If you go to this feed, you'll notice there is a lot of information that needs to be parsed down to use it, so after some fiddling, I came up with the following YQL Feed:&lt;br /&gt;&lt;br /&gt;select entry.title.content, entry.summary.content from xml where url='http://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/basic' AND entry.content.content LIKE '% + year + %'&lt;br /&gt;&lt;br /&gt;with year being a new Date().getYear() value.&lt;br /&gt;&lt;br /&gt;Anyways, here's the script.  It simply displays a message in a Div if today falls on one of the holidays.&lt;br /&gt;&lt;br /&gt;$(function () {&lt;br /&gt;    var d = new Date();&lt;br /&gt;    var year = d.getYear();&lt;br /&gt;    var shortDay = (d.toDateString()).slice(4, 10);&lt;br /&gt;    var query = &amp;quot;select entry.title.content, entry.summary.content from xml where url='http://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/basic' AND entry.content.content LIKE '%&amp;quot; + year + &amp;quot;%'&amp;quot;;&lt;br /&gt;    $.getJSON(&lt;br /&gt;  &amp;quot;http://query.yahooapis.com/v1/public/yql?q=&amp;quot; + encodeURIComponent(query) + &amp;quot;&amp;format=json&amp;callback=?&amp;quot;,&lt;br /&gt;  function (data) {&lt;br /&gt;      $.each(data.query.results,&lt;br /&gt;    function (index, item) {&lt;br /&gt;        for (i = 0; i &lt; item.length; i++) {&lt;br /&gt;            var each = item[i];&lt;br /&gt;            var date = ((each.entry.summary).slice(9, 16).replace(',', ''));&lt;br /&gt;            if (jQuery.trim(date) == jQuery.trim(shortDay)) {&lt;br /&gt;                $('&amp;lt;h6&gt;&amp;lt;/h6&gt;').html('Today is ' + each.entry.title + '!').appendTo('#holidays');&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    });&lt;br /&gt;  });&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;You can feel free to download this script if you would like to use it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.joshuablackstone.com/Scripts/HappyHolidays.js"&gt;http://www.joshuablackstone.com/Scripts/HappyHolidays.js&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-6251711853869160900?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/6251711853869160900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/06/use-google-calendar-as-datasource-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/6251711853869160900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/6251711853869160900'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/06/use-google-calendar-as-datasource-for.html' title='Use Google Calendar as Datasource for Holiday Notifications'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-2002165768024682419</id><published>2010-06-04T10:28:00.000-07:00</published><updated>2010-06-04T10:38:30.924-07:00</updated><title type='text'>Using YQL and Google Translate to Translate Text</title><content type='html'>Had a little time to play, so I wanted to see what I could do to internationalize (I think that's a word :) ) my site.  I noticed in YQL there was a GoogleTranslate Table, so after some trial and error, found out that with:&lt;br /&gt;&lt;br /&gt;select * from json where url='http://www.google.com/uds/Gtranslate?context=22&amp;langpair=%7C&amp;quot; + lang + &amp;quot;&amp;v=1.0&amp;q=&amp;quot; + encodeURIComponent(str) + &amp;quot;'&lt;br /&gt;&lt;br /&gt;with the variables being, of course, lang for language symbol (i.e. en for english, de for dutch, etc.) and str for Text String to be translated.  Plug that into a YQL Json function and you're set, well, almost...&lt;br /&gt;&lt;br /&gt;Why not also scrape the items from the Google Site to use for a Combo Box to select a language from?  If you go to: &lt;a href="http://translate.google.com"&gt;http://translate.google.com&lt;/a&gt;, you will see a combo box next to TranslateInto.  To Get the data from that, simply use this query as your JSON String:&lt;br /&gt;&lt;br /&gt;http://query.yahooapis.com/v1/public/yql?q=select%20option%20from%20html(0)%20where%20url%3D%22http%3A%2F%2Ftranslate.google.com%22%20and%0D%0A%20%20%20%20%20%20xpath%3D'%2F%2Fselect%5B%40class%3D%22tllangdropdown%22%5D'&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback=?&lt;br /&gt;&lt;br /&gt;Plug that into the YQL Console, and you will find that you can get the value and Content for items to plug into a combo box of your own.&lt;br /&gt;&lt;br /&gt;Finally, wire up the dropdown that was created with an event similar to:&lt;br /&gt;&lt;br /&gt;$(&amp;quot;#DROPDOWNNAME&amp;quot;).change(function () {&lt;br /&gt;    translateText($(str).html(), this.value);&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;And you're all done.&lt;br /&gt;&lt;br /&gt;I realize this was a very brief explaination, but for the full script simply go to:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.joshuablackstone.com/Scripts/GTranslate.js"&gt;http://www.joshuablackstone.com/Scripts/GTranslate.js&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-2002165768024682419?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/2002165768024682419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/06/using-yql-and-google-translate-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2002165768024682419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2002165768024682419'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/06/using-yql-and-google-translate-to.html' title='Using YQL and Google Translate to Translate Text'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-7257222528866243857</id><published>2010-05-20T12:54:00.000-07:00</published><updated>2010-05-20T13:01:28.227-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Access True Wildcard Form Search</title><content type='html'>Needed to build a searchform in MS Access which will allow searching of one or multiple fields.  I know that in Sql, this can be accomplished by using:&lt;br /&gt;&lt;br /&gt;SELECT * FROM Table where IsNull([ID],'') LIKE IsNull('%' + @ID + '%','%') &lt;br /&gt;&lt;br /&gt;However, Access doesn't recognize this as a valid statement, so back to the drawing board...&lt;br /&gt;&lt;br /&gt;Eventually I came up with this solution...&lt;br /&gt;&lt;br /&gt;IIf(IsNull([Forms]![Form]![Control]),[FieldName],LIKE &amp;quot;*&amp;quot; &amp; [Forms]![Form]![Control] &amp; &amp;quot;*&amp;quot;)&lt;br /&gt;&lt;br /&gt;With Form being the Form name, and Control being the Control Name.&lt;br /&gt;&lt;br /&gt;In a nutshell, this is saying If IsNull(Form Control) Is True, i.e., If no value was put into the search form for this field, then simply show all items in that field.  Otherwise, show all items that are LIKE (Wildcard Search) the search criteria.&lt;br /&gt;&lt;br /&gt;Hope this helps someone else...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-7257222528866243857?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/7257222528866243857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/05/access-true-wildcard-form-search.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/7257222528866243857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/7257222528866243857'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/05/access-true-wildcard-form-search.html' title='Access True Wildcard Form Search'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-5057721978432249674</id><published>2010-04-23T10:35:00.000-07:00</published><updated>2010-04-23T10:41:48.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yql json yahoo US Dropdownlist'/><title type='text'>YQL create states Dropdown List</title><content type='html'>OK, a very simple one today.&lt;br /&gt;&lt;br /&gt;Using YQL's upcoming.state table, you can create a simple dropdown list to store either the State name or the State Abbreviation.&lt;br /&gt;&lt;br /&gt;HTML Page:&lt;br /&gt;&lt;br /&gt;Create a select element, and give it an id of ddlStates.&lt;br /&gt;&lt;br /&gt;The jQuery Script:&lt;br /&gt;&lt;br /&gt;$(function () {&lt;br /&gt;    var query = "select code, name from upcoming.state where country_id = 1 and id &lt;= 51";&lt;br /&gt;    $.getJSON(&lt;br /&gt;  "http://query.yahooapis.com/v1/public/yql?q=" + encodeURIComponent(query) + "&amp;format=json&amp;callback=?",&lt;br /&gt;  function (data) {&lt;br /&gt;      $.each(data.query.results,&lt;br /&gt;    function (index, item) {&lt;br /&gt;        for (i = 0; i &amp;lt; item.length; i++) {&lt;br /&gt;            var each = item[i];&lt;br /&gt;            var stateName = each.name.toUpperCase();&lt;br /&gt;            var stateCode = each.code.toUpperCase();&lt;br /&gt;            $('&amp;lt;option&gt;&amp;lt;/option&gt;').val(stateName).html(stateCode).appendTo("#ddlStates");&lt;br /&gt;        }&lt;br /&gt;    });&lt;br /&gt;  });&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;You'll note here I simply changed it to Uppercase, and used the value of State Name, while displaying the state code.&lt;br /&gt;&lt;br /&gt;Download Script at:  &lt;a href="http://www.joshuablackstone.com/Scripts/StatesDropdown.js"&gt;http://www.joshuablackstone.com/Scripts/StatesDropdown.js&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And all this time I was storing the data in a database... Ugh...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-5057721978432249674?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/5057721978432249674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/04/yql-create-states-dropdown-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/5057721978432249674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/5057721978432249674'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/04/yql-create-states-dropdown-list.html' title='YQL create states Dropdown List'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-4639449589149563668</id><published>2010-04-22T13:10:00.000-07:00</published><updated>2010-04-22T13:23:10.217-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yql json yahoo feed'/><title type='text'>Using YQL create Food Network Search</title><content type='html'>More YQL, gotta love how easy they have made this!!&lt;br /&gt;&lt;br /&gt;I have found that Food Network can be quite good at making boring foods, well... not so boring.  Wondered what it would take to search their system from another webpage. They don't have a feed for you, so what to do?  YQL's html table...&lt;br /&gt;&lt;br /&gt;Go to the YQL Console, and enter:&lt;br /&gt;&lt;br /&gt;select h3 from html where url=&amp;quot;http://www.foodnetwork.com/search/delegate.do?fnSearchString=FOODITEM&amp;fnSearchType=site&amp;quot; and&lt;br /&gt;      xpath='//div[@class=&amp;quot;result-item&amp;quot;]'&lt;br /&gt;&lt;br /&gt;as your query.  You'll notice it breaks it down to a simple array of h3 elements.  &lt;br /&gt;From there, simply create an array and show the results in an unordered list.&lt;br /&gt;&lt;br /&gt;HTML Page:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Add jQuery to your Page&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a textbox called txtSearch&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a button called btnSearch&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create an unordered list called searchResults&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;JS Code:&lt;br /&gt;&lt;br /&gt;function searchRecipes(search) {&lt;br /&gt;    $('#searchResults').empty();&lt;br /&gt;    $.getJSON(&lt;br /&gt;  "http://query.yahooapis.com/v1/public/yql?q=select%20h3%20from%20html(5)%20where%20url%3D%22http%3A%2F%2Fwww.foodnetwork.com%2Fsearch%2Fdelegate.do%3FfnSearchString%3D" + search + "%26fnSearchType%3Dsite%22%20and%0D%0A%20%20%20%20%20%20xpath%3D'%2F%2Fdiv%5B%40class%3D%22result-item%22%5D'&amp;format=json&amp;callback=?",&lt;br /&gt;  function (data) {&lt;br /&gt;      $.each(data.query.results,&lt;br /&gt;    function (index, item) {&lt;br /&gt;        for (i = 0; i &lt; item.length; i++) {&lt;br /&gt;            var each = item[i];&lt;br /&gt;            var link = (each.h3.a.href).replace('/', 'http://www.foodnetwork.com/');&lt;br /&gt;            $('&amp;lt;li&gt;&amp;lt;/li&gt;').html('&lt;a target="_blank" href="' + link + '"&gt;' + each.h3.a.content + '&lt;/a&gt;').appendTo('#searchResults');&lt;br /&gt;        }&lt;br /&gt;    });&lt;br /&gt;  });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$("#btnSearch").click(function () {&lt;br /&gt;    var searchText = document.getElementById('txtSearch').value;&lt;br /&gt;    if (searchText == "") {&lt;br /&gt;        alert('You must first enter a food to search!');&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        searchRecipes(searchText);&lt;br /&gt;    }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;There you have it.  Enter a food to search in the textbox, click on btnSearch, and a list of recipes are found.  Only returns 12, as that is how the site is setup, but its a nice basic example of yql page scraping...&lt;br /&gt;&lt;br /&gt;Oh, by the way, if you want a copy of the script, feel free to download at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.joshuablackstone.com/Scripts/Searches/FoodNetwork.js"&gt;http://www.joshuablackstone.com/Scripts/Searches/FoodNetwork.js&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-4639449589149563668?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/4639449589149563668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/04/using-yql-create-food-network-search.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/4639449589149563668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/4639449589149563668'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/04/using-yql-create-food-network-search.html' title='Using YQL create Food Network Search'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-2993785610670834375</id><published>2010-03-16T09:33:00.000-07:00</published><updated>2010-03-16T09:38:35.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='White Pages'/><category scheme='http://www.blogger.com/atom/ns#' term='Jquery'/><title type='text'>White Pages API Sample</title><content type='html'>I was looking on the web, and found that there are few if any real samples available for the White Pages People and Reverse Number Searches.&lt;br /&gt;&lt;br /&gt;I've posted a simple example that has 2 search forms.  The first one is a simple people search that takes the name and the zip code as parameters and displays the results below.&lt;br /&gt;&lt;br /&gt;The second search was simpler, as I simply ask for a 10 digit phone number and it displays the results found below as well.  You can optionally pass a state code in place of the area code, but I figured i'd keep it simple for now.&lt;br /&gt;&lt;br /&gt;If anyone is interested in checking it out, there is source code and a working example available at:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.joshuablackstone.net/WhitePagesAPI/"&gt;Sample with Source&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Hope this helps someone out...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-2993785610670834375?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/2993785610670834375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/03/white-pages-api-sample.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2993785610670834375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2993785610670834375'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/03/white-pages-api-sample.html' title='White Pages API Sample'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-3544859303967730758</id><published>2010-03-14T15:16:00.000-07:00</published><updated>2010-03-14T16:00:55.725-07:00</updated><title type='text'>NYTimes Json Feeds</title><content type='html'>Just getting started at this, but I'm planning on working now with the New York Times JSON API that is provided.  &lt;br /&gt;&lt;br /&gt;Looks like this is a very solid api, that allows for feeds from entertainment, to current Congress members, to much, much more...&lt;br /&gt;&lt;br /&gt;Just signed up for my membership and requested an API by going to: &lt;a href="http://developer.nytimes.com/apps/register"&gt;NY Times Registration&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A quick example that I just used for testing...&lt;br /&gt;&lt;br /&gt;    $.getJSON(&lt;br /&gt;  "http://api.nytimes.com/svc/news/v2/all/recent.json?api-key=XXX",&lt;br /&gt;  function(data) {&lt;br /&gt;      $.each(data.results,&lt;br /&gt;    function(index, item) {&lt;br /&gt;    var myItem = $("&amp;lt;ul&gt;&amp;lt;/ul&gt;");&lt;br /&gt;        $("&amp;lt;li&gt;&amp;lt;/li&gt;").html(item.headline).appendTo(myItem)&lt;br /&gt;.wrap("&amp;lt;a target='_blank' href='" + item.url + "')&gt;&amp;lt;/a&gt;");&lt;br /&gt;        myItem.appendTo("#results");&lt;br /&gt;    });&lt;br /&gt;  });&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;Send that to a div called 'results', and you're done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-3544859303967730758?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/3544859303967730758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/03/nytimes-json-feeds.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/3544859303967730758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/3544859303967730758'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/03/nytimes-json-feeds.html' title='NYTimes Json Feeds'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-1268126144034252077</id><published>2010-03-07T14:04:00.000-08:00</published><updated>2010-03-07T14:07:06.821-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yql json yahoo feed'/><title type='text'>YQL Basic JSON Yahoo News Feed</title><content type='html'>Just getting started with YQL and JSON Feeds, must say im impressed...&lt;br /&gt;&lt;br /&gt;A quick script to pull the top stories from yahoo news in a JSON Feed&lt;br /&gt;&lt;br /&gt;    $.getJSON(&lt;br /&gt;  "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22http%3A%2F%2Frss.news.yahoo.com%2Frss%2Ftopstories%22&amp;format=json&amp;env=http%3A%2F%2Fdatatables.org%2Falltables.env&amp;format=json&amp;callback?",  &lt;br /&gt;  function(data) {&lt;br /&gt;    $.each(data.query.results.item,&lt;br /&gt;    function(index, item) {&lt;br /&gt;    var myItem = $("&lt;div&gt;&lt;/div&gt;");&lt;br /&gt;    $("&lt;a&gt;&lt;/a&gt;").html(item.title).attr("href", item.link).appendTo(myItem);&lt;br /&gt;   $("&lt;br /&gt;").appendTo(myItem);&lt;br /&gt;    myItem.appendTo("#MYDIVID");&lt;br /&gt;});&lt;br /&gt;  }&lt;br /&gt;); &lt;br /&gt;&lt;br /&gt;That's all it takes...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-1268126144034252077?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/1268126144034252077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/03/yql-basic-json-yahoo-news-feed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1268126144034252077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/1268126144034252077'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/03/yql-basic-json-yahoo-news-feed.html' title='YQL Basic JSON Yahoo News Feed'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-2784200725937839920</id><published>2010-03-04T13:36:00.000-08:00</published><updated>2010-03-04T13:39:58.186-08:00</updated><title type='text'>Post Server Side without Postback</title><content type='html'>I was reading from the following article:&lt;br /&gt;&lt;br /&gt;http://disturbedbuddha.wordpress.com/2008/01/08/executing-server-side-code-from-javascript/&lt;br /&gt;&lt;br /&gt;and realized that this opened up some possibilities for me.  Hopefully it can for you as well.  &lt;br /&gt;It discusses the use of combining both Javascript and Server-Side Code.  I took his example a step further.&lt;br /&gt;Lets say that you want to validate a user form, but you don't want to have a postback to the server during the validation.  Javascript would be the preference here, and it could look similar to the following:&lt;br /&gt;&lt;br /&gt;if&lt;br /&gt;(document.formname.elementname.value == "") {&lt;br /&gt;var results = document.getElementById('resultslabel');&lt;br /&gt;results.innerHTML = ("Please put in a name.");&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;and the control to validate would simply be a standard html button:&lt;br /&gt;&lt;br /&gt;&amp;lt;input type=button onclick=formCheck(); value=Submit /&amp;gt;&lt;br /&gt;&lt;br /&gt;However, let's say that you want to include a server-side event after the validation is complete.  I tried first to simply add a onserverclick event handler to the button, but it posted back everytime regardless of the client status.  I tried using an Update Panel, with a standard asp.net button control, same thing.  This hack solved the trick.  I added an ASP.NET Button, called it Button2, such as:&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button ID=Button2 runat=server style=display:none; onclick=Button2_Click /&amp;gt;&lt;br /&gt;(note the style tag...), and added a Server-side event handler to Button2.&lt;br /&gt;&lt;br /&gt;Now, simply add the line:  &lt;br /&gt;&lt;br /&gt;document.getElementByID('Button2').click();&lt;br /&gt;&lt;br /&gt;after the if condition in your javascript code.  &lt;br /&gt;Easier than I thought...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-2784200725937839920?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/2784200725937839920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/03/post-server-side-without-postback.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2784200725937839920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/2784200725937839920'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/03/post-server-side-without-postback.html' title='Post Server Side without Postback'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4767653015949736449.post-5485832374886276744</id><published>2010-03-04T06:14:00.000-08:00</published><updated>2010-03-04T07:40:37.531-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='Flickr'/><category scheme='http://www.blogger.com/atom/ns#' term='Feed'/><title type='text'>JSON Flickr Feed from Username</title><content type='html'>I needed to find a way to show flickr pictures for a Portal, and chose to hide the username in a hidden field to retrieve once it was given in registration.  It's simple to use a JSON feed to retrieve a user's items if you know the User ID, but it's an extra step to acquire the User ID from the Username.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution&lt;/strong&gt;: the Flickr findByUsername function&lt;br /&gt;The first method requires a Flickr API Key.  You can get this by going to: &lt;a href='http://www.flickr.com/services/apps/create/apply/' target='_blank'&gt;The App Garden&lt;/a&gt;. After you have signed up for an API, you can then proceed.&lt;br /&gt;&lt;br /&gt;First, in the body, I created a hidden field called 'flickrUsername'.  Then, i created a div called 'photoResults' to house the data.&lt;br /&gt;&lt;br /&gt;Next, the jquery script:&lt;br /&gt;&lt;br /&gt;$(function(){&lt;br /&gt;&lt;br /&gt;var name = $('#hiddenFieldID');&lt;br /&gt;if (name == ""){&lt;br /&gt;$("#photoResults").html("Missing Flickr Username!");&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;        var userID;&lt;br /&gt;        $.getJSON("http://api.flickr.com/services/rest/?method=flickr.people.findByUsername&amp;username=" + name + "&amp;api_key=fa70b734cfb2cd4858f509230aba0328&amp;format=json&amp;jsoncallback=?", function(data) {&lt;br /&gt;            userID = data.user.id;&lt;br /&gt;            $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=" + userID + "&amp;lang=en-us&amp;format=json&amp;jsoncallback=?", function(data) {&lt;br /&gt;                $.each(data.items, function(i, item) {&lt;br /&gt;                    $("&amp;lt;img/&amp;gt;").attr("src", item.media.m).appendTo("#photoResults");&lt;br /&gt;                });&lt;br /&gt;            });&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;This will then display an array of that particular user's images.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4767653015949736449-5485832374886276744?l=jblackstone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jblackstone.blogspot.com/feeds/5485832374886276744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jblackstone.blogspot.com/2010/03/json-flickr-feed-from-only-username.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/5485832374886276744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4767653015949736449/posts/default/5485832374886276744'/><link rel='alternate' type='text/html' href='http://jblackstone.blogspot.com/2010/03/json-flickr-feed-from-only-username.html' title='JSON Flickr Feed from Username'/><author><name>Joshua Blackstone</name><uri>http://www.blogger.com/profile/15745676993502416824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_x-0uyvXOChs/S4_TNayYd0I/AAAAAAAAACY/g1bQD67lypk/S220/Me.JPG'/></author><thr:total>0</thr:total></entry></feed>
