Re: [CODE4LIB] Library Hours Fail

2015-01-13 Thread Tom Keays
Here's a status update on how I am using the LibCal Hours API to display
hours on my library's homepage.  For MPOW, the API gave me a URL for JSON
as:

https://api3.libcal.com/api_hours_grid.php?iid=567&format=json&weeks=1

The problem I had was that the LibCal v2 documentation didn't say how to
obtain JSONP rather than JSON in order to avoid the CORS problem. I
resigned myself to writing my own custom PHP script to turn the LibCal JSON
into JSONP, but Emily King pointed me in the right direction and a
programmer at SpringShare advised me that all I had to do was to add the
string "&callback=?" at the end of the URL to generate JSONP directly.
E.G.,

https://api3.libcal.com/api_hours_grid.php?iid=567&format=json&weeks=1&callback=
?

After playing around with several other APIs to gain experience working
with JSON, I have come to realize this is a common practice (adding the
callback attribute) and that it is often undocumented. I guess you are just
supposed to know.

Here's a codepen displaying the current week's hours. If the "currently_open"
attribute for a given day is set to "true" -- i.e., is it today and are we
currently open -- a CSS class is added to highlight that day in the list.

http://codepen.io/tomkeays/pen/MYewYN?editors=001

Our situation is that we have extended hours from 9 pm - 2 am from Sunday -
Thursday, when patrons have to use their ID cards as keycards to swipe and
gain entrance to the building. LibCal let me set this up quite easily. In
the pen, if you change the offset from 0 to 1 (from current week to next
week), you can see what that looks like.

Tom



On Mon, Dec 15, 2014 at 4:11 PM, Tom Keays  wrote:

> I've been playing with the hours options in LibCal. I especially like
> being able to pull out today's hours so easily. LibCal gives you options to
> do this using HTML (iframe), JavaScript, JSON, or RSS.
>
> HTML and JavaScript both format the output in a table, which is probably
> desirable if you have multiple locations, but maybe less good if you have
> one location only. That made me want to look into rolling my own solution
> using the JSON option.
>
> The problem is that to avoid XSS vulnerabilities, you can't use plain
> JSON, but must instead use JSONP, which is NOT an option being offered by
> LibCal (if anybody knows otherwise, I'd appreciate the information).
>
> So, my solution was to write a meatball PHP script that wraps the JSON in
> a JSONP callback. I wish I didn't have to do the extra server hop, but it
> works. Here's my demo.
>
> http://codepen.io/tomkeays/pen/EaKrgg/?editors=101
>
> Now, I wish there was a JSON option to display a week's worth of hours for
> a given location instead of just the one day's worth.
>
>
> On Tue, Nov 18, 2014 at 4:17 PM, Heidi Steiner Burkhardt <
> hmstei...@gmail.com> wrote:
>>
>> Hi Mary,
>>
>> You mentioned LibCal and I do not think anyone else has addressed this
>> yet...you can use the Hours module for one location with the free version
>> . The one location piece is the
>> only
>> limitation...so it should work for you if you just need it for one
>> library's hours. It is what we use on our website
>> . You can set the
>> hours
>> for the whole year (using templates and exceptions) and then do not have
>> to
>> worry about it. There are a few different widget/API options
>> .
>>
>> All best,
>> Heidi
>>
>> --
>> Heidi Steiner Burkhardt
>> Head of Digital Services
>> Kreitzberg Library, Norwich University
>> 158 Harmon Dr. Northfield, Vermont
>> 802.485.2171
>>
>>
>>
>>
>> On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
>> wrote:
>>
>> > Hi All,
>> >
>> > I know this has been covered a bit here, but I have a rather exigent
>> > conundrum, and I'm hoping to figure out the best/easiest solution.
>> > Yesterday, the script to hour library hours (on our front page) which
>> pulls
>> > from Google calendar stopped working ("Error at line undefined in
>> > undefined[!]" - the exclamation point is mine; it seemed like it needed
>> > one.)
>> >
>> > Basically, the code came from a site that walked one through how to call
>> > daily hours (javascript) using Google's V2 API, but the V2 is fully
>> > deprecated (as I abruptly discovered), and I need to figure out another
>> > solution.  (I haven't been able to find similar documentation for V3's
>> API.)
>> >
>> > Some constraints: 1. Our IT will not support php.We are an .NET shop
>> > with IIS servers.  2. We may not have the dough to pay for something
>> like
>> > LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
>> > "Internets/webmaster" thing, and really only know front-end coding, so a
>> > solution involving something like .NET, Python, etc. would have to have,
>> > "How to make a peanut butter sandwich," kind of documentation.
>> >
>> > Right now, I've just manually coded our hours, which is fine until
>> > 

Re: [CODE4LIB] Library Hours Fail

2014-12-15 Thread Tom Keays
I've been playing with the hours options in LibCal. I especially like being
able to pull out today's hours so easily. LibCal gives you options to do
this using HTML (iframe), JavaScript, JSON, or RSS.

HTML and JavaScript both format the output in a table, which is probably
desirable if you have multiple locations, but maybe less good if you have
one location only. That made me want to look into rolling my own solution
using the JSON option.

The problem is that to avoid XSS vulnerabilities, you can't use plain JSON,
but must instead use JSONP, which is NOT an option being offered by LibCal
(if anybody knows otherwise, I'd appreciate the information).

So, my solution was to write a meatball PHP script that wraps the JSON in a
JSONP callback. I wish I didn't have to do the extra server hop, but it
works. Here's my demo.

http://codepen.io/tomkeays/pen/EaKrgg/?editors=101

Now, I wish there was a JSON option to display a week's worth of hours for
a given location instead of just the one day's worth.


On Tue, Nov 18, 2014 at 4:17 PM, Heidi Steiner Burkhardt <
hmstei...@gmail.com> wrote:
>
> Hi Mary,
>
> You mentioned LibCal and I do not think anyone else has addressed this
> yet...you can use the Hours module for one location with the free version
> . The one location piece is the only
> limitation...so it should work for you if you just need it for one
> library's hours. It is what we use on our website
> . You can set the hours
> for the whole year (using templates and exceptions) and then do not have to
> worry about it. There are a few different widget/API options
> .
>
> All best,
> Heidi
>
> --
> Heidi Steiner Burkhardt
> Head of Digital Services
> Kreitzberg Library, Norwich University
> 158 Harmon Dr. Northfield, Vermont
> 802.485.2171
>
>
>
>
> On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
> wrote:
>
> > Hi All,
> >
> > I know this has been covered a bit here, but I have a rather exigent
> > conundrum, and I'm hoping to figure out the best/easiest solution.
> > Yesterday, the script to hour library hours (on our front page) which
> pulls
> > from Google calendar stopped working ("Error at line undefined in
> > undefined[!]" - the exclamation point is mine; it seemed like it needed
> > one.)
> >
> > Basically, the code came from a site that walked one through how to call
> > daily hours (javascript) using Google's V2 API, but the V2 is fully
> > deprecated (as I abruptly discovered), and I need to figure out another
> > solution.  (I haven't been able to find similar documentation for V3's
> API.)
> >
> > Some constraints: 1. Our IT will not support php.We are an .NET shop
> > with IIS servers.  2. We may not have the dough to pay for something like
> > LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> > "Internets/webmaster" thing, and really only know front-end coding, so a
> > solution involving something like .NET, Python, etc. would have to have,
> > "How to make a peanut butter sandwich," kind of documentation.
> >
> > Right now, I've just manually coded our hours, which is fine until
> > Saturday when our hours change, and I'm not here (hopefully).  I will be
> > super grateful for insight or knowledge.
> >
> > Mary.
> >
> > Mary Hanlin
> > Electronic Resources and Web Librarian
> > J. Sargeant Reynolds Community College
> > Phone:804.523.5323
> > Email: mhan...@reynolds.edu
> >
>


Re: [CODE4LIB] Library Hours Fail

2014-11-23 Thread Fitchett, Deborah
We'd been using Andrew Darby's method and ran into this problem earlier this 
year. A (now ex-)colleague coded "Calibr" 
(https://github.com/LincolnUniLTL/calibr ) when we ran into this problem, and 
we've been running it since. Does depend on tidy csv though.

Deborah

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Heller, 
Margaret
Sent: Wednesday, 19 November 2014 11:51 a.m.
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Library Hours Fail

Wish I had checked the list this morning, as I just discovered we had the same 
problem. We have been using Andrew Darby's method outlined here: 
http://journal.code4lib.org/articles/46.

Is there by any chance someone using this method who happened to know the V2 
API was being deprecated who already updated their app to V3?

If not anyone who wants to work on getting this to work tomorrow?

Margaret Heller
Digital Services Librarian
Loyola University Chicago
773-508-2686

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Mary E. 
Hanlin
Sent: Tuesday, November 18, 2014 8:19 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: [CODE4LIB] Library Hours Fail

Hi All,

I know this has been covered a bit here, but I have a rather exigent conundrum, 
and I'm hoping to figure out the best/easiest solution.  Yesterday, the script 
to hour library hours (on our front page) which pulls from Google calendar 
stopped working ("Error at line undefined in undefined[!]" - the exclamation 
point is mine; it seemed like it needed one.)

Basically, the code came from a site that walked one through how to call daily 
hours (javascript) using Google's V2 API, but the V2 is fully deprecated (as I 
abruptly discovered), and I need to figure out another solution.  (I haven't 
been able to find similar documentation for V3's API.)

Some constraints: 1. Our IT will not support php.We are an .NET shop with 
IIS servers.  2. We may not have the dough to pay for something like LibCal 
which seems to me the easiest solution.  3.  I'm semi-new to this 
"Internets/webmaster" thing, and really only know front-end coding, so a 
solution involving something like .NET, Python, etc. would have to have, "How 
to make a peanut butter sandwich," kind of documentation.

Right now, I've just manually coded our hours, which is fine until Saturday 
when our hours change, and I'm not here (hopefully).  I will be super grateful 
for insight or knowledge.

Mary.

Mary Hanlin
Electronic Resources and Web Librarian
J. Sargeant Reynolds Community College
Phone:804.523.5323
Email: mhan...@reynolds.edu


P Please consider the environment before you print this email.
"The contents of this e-mail (including any attachments) may be confidential 
and/or subject to copyright. Any unauthorised use, distribution, or copying of 
the contents is expressly prohibited. If you have received this e-mail in 
error, please advise the sender by return e-mail or telephone and then delete 
this e-mail together with all attachments from your system."


Re: [CODE4LIB] Library Hours Fail

2014-11-19 Thread Brad Coffield
Heidi: You just made my day. I hadn't realized we could run that through
libcal. We have a couple calendars through them but have never used them. I
have the weekly javascript option (like Nick mentioned) running our Today's
Hours now and I'm so excited that I'll be able to set it and forget it for
the whole year (instead of changing every time there's a schedule deviation
- and then changing back.)

woohoo!

On Wed, Nov 19, 2014 at 11:07 AM, Sarah Park  wrote:

> Josh,
>
> A nice job. I like how you integrated the hours in your homepage, too.
> For people who did not see it: https://library.ucmo.edu/
>
> I helped a friend upgrading a hours calendar to API v3 from API v2 last
> night. The major difference between v2 and. v3 is the returned data is
> changed from Atom feed to JSon, in addition to the requirement of OAuth
> authorization. I added OAuth code (following the Google's example) first.
> Then, I changed a few lines and property names in the listEvents function
> to parse the data correctly.
>
> This is what I came up with. The source code is written in JavaScript.
> http://bit.ly/nwlivecalendar (see the libhours.js file in the source code)
>
> Sarah Park
>
> -Original Message-
> From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of
> Joshua Welker
> Sent: Wednesday, November 19, 2014 8:39 AM
> To: CODE4LIB@LISTSERV.ND.EDU
> Subject: Re: [CODE4LIB] Library Hours Fail
>
> I have a solution running that is compatible with API V3 but it is pretty
> specific to Ruby on Rails. The idea is to use Google's iCal interface
> rather than the API. iCal is going to stay the same no matter how many
> iterations the API goes through. You basically just need to find an iCal
> parsing library for whatever language you are using. The only problem is
> that Google does a bad job with exceptions to recurrence rules (rrules).
> Instead of editing a single event in a repeating series, you have to delete
> that event and re-add it as a separate event.
>
> https://gist.github.com/jswelker/04997f378d9bc02311d2
>
> In this example, I have a MySQL table listing several Google Calendars and
> the URL given for their iCal files in the calendar settings page. It loops
> through each calendar, fetches the iCal, parses it, and saves the resulting
> hours to a separate Events table. This might be more complicated than
> people are wanting.
>
> Josh Welker
>
>
> -Original Message-
> From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of
> Heller, Margaret
> Sent: Tuesday, November 18, 2014 4:51 PM
> To: CODE4LIB@LISTSERV.ND.EDU
> Subject: Re: [CODE4LIB] Library Hours Fail
>
> Wish I had checked the list this morning, as I just discovered we had the
> same problem. We have been using Andrew Darby's method outlined here:
> http://journal.code4lib.org/articles/46.
>
> Is there by any chance someone using this method who happened to know the
> V2 API was being deprecated who already updated their app to V3?
>
> If not anyone who wants to work on getting this to work tomorrow?
>
> Margaret Heller
> Digital Services Librarian
> Loyola University Chicago
> 773-508-2686
>
> -Original Message-
> From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of
> Mary E. Hanlin
> Sent: Tuesday, November 18, 2014 8:19 AM
> To: CODE4LIB@LISTSERV.ND.EDU
> Subject: [CODE4LIB] Library Hours Fail
>
> Hi All,
>
> I know this has been covered a bit here, but I have a rather exigent
> conundrum, and I'm hoping to figure out the best/easiest solution.
> Yesterday, the script to hour library hours (on our front page) which
> pulls from Google calendar stopped working ("Error at line undefined in
> undefined[!]" - the exclamation point is mine; it seemed like it needed
> one.)
>
> Basically, the code came from a site that walked one through how to call
> daily hours (javascript) using Google's V2 API, but the V2 is fully
> deprecated (as I abruptly discovered), and I need to figure out another
> solution.  (I haven't been able to find similar documentation for V3's API.)
>
> Some constraints: 1. Our IT will not support php.We are an .NET shop
> with IIS servers.  2. We may not have the dough to pay for something like
> LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> "Internets/webmaster" thing, and really only know front-end coding, so a
> solution involving something like .NET, Python, etc. would have to have,
> "How to make a peanut butter sandwich," kind of documentation.
>
> Right now, I've just manually coded our hours, which is fine until
> Saturday when our hours change, and I'm not here (hopefully).  I will be
> super grateful for insight or knowledge.
>
> Mary.
>
> Mary Hanlin
> Electronic Resources and Web Librarian
> J. Sargeant Reynolds Community College
> Phone:804.523.5323
> Email: mhan...@reynolds.edu
>



-- 
Brad Coffield, MLIS
Assistant Information and Web Services Librarian
Saint Francis University
814-472-3315
bcoffi...@francis.edu


Re: [CODE4LIB] Library Hours Fail

2014-11-19 Thread Sarah Park
Josh, 

A nice job. I like how you integrated the hours in your homepage, too. 
For people who did not see it: https://library.ucmo.edu/

I helped a friend upgrading a hours calendar to API v3 from API v2 last night. 
The major difference between v2 and. v3 is the returned data is changed from 
Atom feed to JSon, in addition to the requirement of OAuth authorization. I 
added OAuth code (following the Google's example) first. Then, I changed a few 
lines and property names in the listEvents function to parse the data 
correctly. 

This is what I came up with. The source code is written in JavaScript.
http://bit.ly/nwlivecalendar (see the libhours.js file in the source code)

Sarah Park

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Joshua 
Welker
Sent: Wednesday, November 19, 2014 8:39 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Library Hours Fail

I have a solution running that is compatible with API V3 but it is pretty 
specific to Ruby on Rails. The idea is to use Google's iCal interface rather 
than the API. iCal is going to stay the same no matter how many iterations the 
API goes through. You basically just need to find an iCal parsing library for 
whatever language you are using. The only problem is that Google does a bad job 
with exceptions to recurrence rules (rrules). Instead of editing a single event 
in a repeating series, you have to delete that event and re-add it as a 
separate event.

https://gist.github.com/jswelker/04997f378d9bc02311d2

In this example, I have a MySQL table listing several Google Calendars and the 
URL given for their iCal files in the calendar settings page. It loops through 
each calendar, fetches the iCal, parses it, and saves the resulting hours to a 
separate Events table. This might be more complicated than people are wanting.

Josh Welker


-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Heller, 
Margaret
Sent: Tuesday, November 18, 2014 4:51 PM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Library Hours Fail

Wish I had checked the list this morning, as I just discovered we had the same 
problem. We have been using Andrew Darby's method outlined here:
http://journal.code4lib.org/articles/46.

Is there by any chance someone using this method who happened to know the V2 
API was being deprecated who already updated their app to V3?

If not anyone who wants to work on getting this to work tomorrow?

Margaret Heller
Digital Services Librarian
Loyola University Chicago
773-508-2686

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Mary E. 
Hanlin
Sent: Tuesday, November 18, 2014 8:19 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: [CODE4LIB] Library Hours Fail

Hi All,

I know this has been covered a bit here, but I have a rather exigent conundrum, 
and I'm hoping to figure out the best/easiest solution.
Yesterday, the script to hour library hours (on our front page) which pulls 
from Google calendar stopped working ("Error at line undefined in undefined[!]" 
- the exclamation point is mine; it seemed like it needed
one.)

Basically, the code came from a site that walked one through how to call daily 
hours (javascript) using Google's V2 API, but the V2 is fully deprecated (as I 
abruptly discovered), and I need to figure out another solution.  (I haven't 
been able to find similar documentation for V3's API.)

Some constraints: 1. Our IT will not support php.We are an .NET shop
with IIS servers.  2. We may not have the dough to pay for something like 
LibCal which seems to me the easiest solution.  3.  I'm semi-new to this 
"Internets/webmaster" thing, and really only know front-end coding, so a 
solution involving something like .NET, Python, etc. would have to have, "How 
to make a peanut butter sandwich," kind of documentation.

Right now, I've just manually coded our hours, which is fine until Saturday 
when our hours change, and I'm not here (hopefully).  I will be super grateful 
for insight or knowledge.

Mary.

Mary Hanlin
Electronic Resources and Web Librarian
J. Sargeant Reynolds Community College
Phone:804.523.5323
Email: mhan...@reynolds.edu


Re: [CODE4LIB] Library Hours Fail

2014-11-19 Thread Joshua Welker
I have a solution running that is compatible with API V3 but it is pretty
specific to Ruby on Rails. The idea is to use Google's iCal interface rather
than the API. iCal is going to stay the same no matter how many iterations
the API goes through. You basically just need to find an iCal parsing
library for whatever language you are using. The only problem is that Google
does a bad job with exceptions to recurrence rules (rrules). Instead of
editing a single event in a repeating series, you have to delete that event
and re-add it as a separate event.

https://gist.github.com/jswelker/04997f378d9bc02311d2

In this example, I have a MySQL table listing several Google Calendars and
the URL given for their iCal files in the calendar settings page. It loops
through each calendar, fetches the iCal, parses it, and saves the resulting
hours to a separate Events table. This might be more complicated than people
are wanting.

Josh Welker


-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of
Heller, Margaret
Sent: Tuesday, November 18, 2014 4:51 PM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: Re: [CODE4LIB] Library Hours Fail

Wish I had checked the list this morning, as I just discovered we had the
same problem. We have been using Andrew Darby's method outlined here:
http://journal.code4lib.org/articles/46.

Is there by any chance someone using this method who happened to know the V2
API was being deprecated who already updated their app to V3?

If not anyone who wants to work on getting this to work tomorrow?

Margaret Heller
Digital Services Librarian
Loyola University Chicago
773-508-2686

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Mary
E. Hanlin
Sent: Tuesday, November 18, 2014 8:19 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: [CODE4LIB] Library Hours Fail

Hi All,

I know this has been covered a bit here, but I have a rather exigent
conundrum, and I'm hoping to figure out the best/easiest solution.
Yesterday, the script to hour library hours (on our front page) which pulls
from Google calendar stopped working ("Error at line undefined in
undefined[!]" - the exclamation point is mine; it seemed like it needed
one.)

Basically, the code came from a site that walked one through how to call
daily hours (javascript) using Google's V2 API, but the V2 is fully
deprecated (as I abruptly discovered), and I need to figure out another
solution.  (I haven't been able to find similar documentation for V3's API.)

Some constraints: 1. Our IT will not support php.We are an .NET shop
with IIS servers.  2. We may not have the dough to pay for something like
LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
"Internets/webmaster" thing, and really only know front-end coding, so a
solution involving something like .NET, Python, etc. would have to have,
"How to make a peanut butter sandwich," kind of documentation.

Right now, I've just manually coded our hours, which is fine until Saturday
when our hours change, and I'm not here (hopefully).  I will be super
grateful for insight or knowledge.

Mary.

Mary Hanlin
Electronic Resources and Web Librarian
J. Sargeant Reynolds Community College
Phone:804.523.5323
Email: mhan...@reynolds.edu


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Steven Pryor
** I sent this earlier today, but it didn't seem to go through, probably 
due to the attachment. I've replaced the previously attached source code 
with this online demo: http://codepen.io/troub/pen/VYYjxM/?editors=101 
** You can just grab the JS part and save it as a .js file and call that 
from your HTML (see below).


We used probably the same javascript code (I remember I adapted it from 
some example buried somewhere in the Google documentation universe). I 
looked at it today and the attached code should work to get going with 
the Calendar API v3 (.txt extension added to avoid getting flagged as 
active code or something).


Like before, you'll need to have a couple of things in your HTML; divs 
that get updated with the content:


Loading Today's Hours




And the script source and a call to the Google Client API code:



https://apis.google.com/js/client.js?onload=handleClientLoad";>


You'll need to make sure you set up a project in the Google Developers 
Console ( https://console.developers.google.com ) and enable the 
Calendar API, then create a browser API key to use in the attached 
script file (somehow the v2 code always worked for us without an actual 
API key, if you were already using one you're halfway there). The .js 
code has the whole bit included for OAuth 2.0 authentication (the 
clientId and scopes variables, and all the "Auth" functions), which as I 
was trying to work this all out seemed necessary at first, but then once 
I got it all working I was able to shortcut past it. Make sure your 
website address(es) are listed as allowed referers on your API key, too.


This is working for us now, and even though it took a while to work 
through exactly what was expected from the API, the new code is much 
simpler than the old, even with the OAuth stuff in there.


Steven
-
/Steven Pryor
Director of Digital Initiatives and Technologies
Library and Information Services
Southern Illinois University Edwardsville
(618) 650-3080
stpr...@siue.edu /

On 11/18/2014 8:18 AM, Mary E. Hanlin wrote:

Hi All,

I know this has been covered a bit here, but I have a rather exigent conundrum, and I'm 
hoping to figure out the best/easiest solution.  Yesterday, the script to hour library 
hours (on our front page) which pulls from Google calendar stopped working ("Error 
at line undefined in undefined[!]" - the exclamation point is mine; it seemed like 
it needed one.)

Basically, the code came from a site that walked one through how to call daily 
hours (javascript) using Google's V2 API, but the V2 is fully deprecated (as I 
abruptly discovered), and I need to figure out another solution.  (I haven't 
been able to find similar documentation for V3's API.)

Some constraints: 1. Our IT will not support php.We are an .NET shop with IIS servers.  2. We 
may not have the dough to pay for something like LibCal which seems to me the easiest solution.  3. 
 I'm semi-new to this "Internets/webmaster" thing, and really only know front-end coding, 
so a solution involving something like .NET, Python, etc. would have to have, "How to make a 
peanut butter sandwich," kind of documentation.

Right now, I've just manually coded our hours, which is fine until Saturday 
when our hours change, and I'm not here (hopefully).  I will be super grateful 
for insight or knowledge.

Mary.

Mary Hanlin
Electronic Resources and Web Librarian
J. Sargeant Reynolds Community College
Phone:804.523.5323
Email:mhan...@reynolds.edu


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Heller, Margaret
Wish I had checked the list this morning, as I just discovered we had the same 
problem. We have been using Andrew Darby's method outlined here: 
http://journal.code4lib.org/articles/46. 

Is there by any chance someone using this method who happened to know the V2 
API was being deprecated who already updated their app to V3? 

If not anyone who wants to work on getting this to work tomorrow?

Margaret Heller
Digital Services Librarian
Loyola University Chicago
773-508-2686

-Original Message-
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Mary E. 
Hanlin
Sent: Tuesday, November 18, 2014 8:19 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: [CODE4LIB] Library Hours Fail

Hi All,

I know this has been covered a bit here, but I have a rather exigent conundrum, 
and I'm hoping to figure out the best/easiest solution.  Yesterday, the script 
to hour library hours (on our front page) which pulls from Google calendar 
stopped working ("Error at line undefined in undefined[!]" - the exclamation 
point is mine; it seemed like it needed one.)  

Basically, the code came from a site that walked one through how to call daily 
hours (javascript) using Google's V2 API, but the V2 is fully deprecated (as I 
abruptly discovered), and I need to figure out another solution.  (I haven't 
been able to find similar documentation for V3's API.) 

Some constraints: 1. Our IT will not support php.We are an .NET shop with 
IIS servers.  2. We may not have the dough to pay for something like LibCal 
which seems to me the easiest solution.  3.  I'm semi-new to this 
"Internets/webmaster" thing, and really only know front-end coding, so a 
solution involving something like .NET, Python, etc. would have to have, "How 
to make a peanut butter sandwich," kind of documentation.  

Right now, I've just manually coded our hours, which is fine until Saturday 
when our hours change, and I'm not here (hopefully).  I will be super grateful 
for insight or knowledge.  

Mary.

Mary Hanlin
Electronic Resources and Web Librarian
J. Sargeant Reynolds Community College
Phone:804.523.5323
Email: mhan...@reynolds.edu


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Heidi Steiner Burkhardt
Hi Mary,

You mentioned LibCal and I do not think anyone else has addressed this
yet...you can use the Hours module for one location with the free version
. The one location piece is the only
limitation...so it should work for you if you just need it for one
library's hours. It is what we use on our website
. You can set the hours
for the whole year (using templates and exceptions) and then do not have to
worry about it. There are a few different widget/API options
.

All best,
Heidi

--
Heidi Steiner Burkhardt
Head of Digital Services
Kreitzberg Library, Norwich University
158 Harmon Dr. Northfield, Vermont
802.485.2171




On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
wrote:

> Hi All,
>
> I know this has been covered a bit here, but I have a rather exigent
> conundrum, and I'm hoping to figure out the best/easiest solution.
> Yesterday, the script to hour library hours (on our front page) which pulls
> from Google calendar stopped working ("Error at line undefined in
> undefined[!]" - the exclamation point is mine; it seemed like it needed
> one.)
>
> Basically, the code came from a site that walked one through how to call
> daily hours (javascript) using Google's V2 API, but the V2 is fully
> deprecated (as I abruptly discovered), and I need to figure out another
> solution.  (I haven't been able to find similar documentation for V3's API.)
>
> Some constraints: 1. Our IT will not support php.We are an .NET shop
> with IIS servers.  2. We may not have the dough to pay for something like
> LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> "Internets/webmaster" thing, and really only know front-end coding, so a
> solution involving something like .NET, Python, etc. would have to have,
> "How to make a peanut butter sandwich," kind of documentation.
>
> Right now, I've just manually coded our hours, which is fine until
> Saturday when our hours change, and I'm not here (hopefully).  I will be
> super grateful for insight or knowledge.
>
> Mary.
>
> Mary Hanlin
> Electronic Resources and Web Librarian
> J. Sargeant Reynolds Community College
> Phone:804.523.5323
> Email: mhan...@reynolds.edu
>


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Doug Chestnut
Sorry, fixed example link as my clipboard is acting up today:
http://uvalib-components.github.io/uvalib-hours-ui/components/uvalib-hours-ui/demo.html


On Tue, Nov 18, 2014 at 10:55 AM, Doug Chestnut 
wrote:

> Hi Mary,
> I'm working up a web component that will do hours from a Google Cal.  It's
> a bit alpha (and bleeding edge) given it's a web component and I haven't
> gotten around to using it in production.  Feel free to ignore the rest of
> this email.
>
> example:
> https://github.com/uvalib-components/uvalib-hours-ui/blob/master/uvalib-hours-ui.html
> repo: https://github.com/uvalib-components/uvalib-hours-ui
>
> Cheers,
> --Doug
>
> On Tue, Nov 18, 2014 at 9:42 AM, Laura Robbins  wrote:
>
>> Hi Mary,
>>
>> Here's an asp script that I used to use to display our hours (
>> http://library.dowling.edu).  It has a feature to allow for predefined
>> closures.  It just needs to be called via javascript from the page you
>> wish
>> to use it on.  We used to have a IIS server, but have recently changed
>> over
>> to a linux one.  So, I had to rewrite it as php, but this always worked
>> reliably.
>>
>> Take care,
>>
>> Laura Pope Robbins
>> Dowling College
>>
>>
>> On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
>> wrote:
>>
>> > Hi All,
>> >
>> > I know this has been covered a bit here, but I have a rather exigent
>> > conundrum, and I'm hoping to figure out the best/easiest solution.
>> > Yesterday, the script to hour library hours (on our front page) which
>> pulls
>> > from Google calendar stopped working ("Error at line undefined in
>> > undefined[!]" - the exclamation point is mine; it seemed like it needed
>> > one.)
>> >
>> > Basically, the code came from a site that walked one through how to call
>> > daily hours (javascript) using Google's V2 API, but the V2 is fully
>> > deprecated (as I abruptly discovered), and I need to figure out another
>> > solution.  (I haven't been able to find similar documentation for V3's
>> API.)
>> >
>> > Some constraints: 1. Our IT will not support php.We are an .NET shop
>> > with IIS servers.  2. We may not have the dough to pay for something
>> like
>> > LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
>> > "Internets/webmaster" thing, and really only know front-end coding, so a
>> > solution involving something like .NET, Python, etc. would have to have,
>> > "How to make a peanut butter sandwich," kind of documentation.
>> >
>> > Right now, I've just manually coded our hours, which is fine until
>> > Saturday when our hours change, and I'm not here (hopefully).  I will be
>> > super grateful for insight or knowledge.
>> >
>> > Mary.
>> >
>> > Mary Hanlin
>> > Electronic Resources and Web Librarian
>> > J. Sargeant Reynolds Community College
>> > Phone:804.523.5323
>> > Email: mhan...@reynolds.edu
>> >
>>
>
>


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Doug Chestnut
Hi Mary,
I'm working up a web component that will do hours from a Google Cal.  It's
a bit alpha (and bleeding edge) given it's a web component and I haven't
gotten around to using it in production.  Feel free to ignore the rest of
this email.

example:
https://github.com/uvalib-components/uvalib-hours-ui/blob/master/uvalib-hours-ui.html
repo: https://github.com/uvalib-components/uvalib-hours-ui

Cheers,
--Doug

On Tue, Nov 18, 2014 at 9:42 AM, Laura Robbins  wrote:

> Hi Mary,
>
> Here's an asp script that I used to use to display our hours (
> http://library.dowling.edu).  It has a feature to allow for predefined
> closures.  It just needs to be called via javascript from the page you wish
> to use it on.  We used to have a IIS server, but have recently changed over
> to a linux one.  So, I had to rewrite it as php, but this always worked
> reliably.
>
> Take care,
>
> Laura Pope Robbins
> Dowling College
>
>
> On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
> wrote:
>
> > Hi All,
> >
> > I know this has been covered a bit here, but I have a rather exigent
> > conundrum, and I'm hoping to figure out the best/easiest solution.
> > Yesterday, the script to hour library hours (on our front page) which
> pulls
> > from Google calendar stopped working ("Error at line undefined in
> > undefined[!]" - the exclamation point is mine; it seemed like it needed
> > one.)
> >
> > Basically, the code came from a site that walked one through how to call
> > daily hours (javascript) using Google's V2 API, but the V2 is fully
> > deprecated (as I abruptly discovered), and I need to figure out another
> > solution.  (I haven't been able to find similar documentation for V3's
> API.)
> >
> > Some constraints: 1. Our IT will not support php.We are an .NET shop
> > with IIS servers.  2. We may not have the dough to pay for something like
> > LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> > "Internets/webmaster" thing, and really only know front-end coding, so a
> > solution involving something like .NET, Python, etc. would have to have,
> > "How to make a peanut butter sandwich," kind of documentation.
> >
> > Right now, I've just manually coded our hours, which is fine until
> > Saturday when our hours change, and I'm not here (hopefully).  I will be
> > super grateful for insight or knowledge.
> >
> > Mary.
> >
> > Mary Hanlin
> > Electronic Resources and Web Librarian
> > J. Sargeant Reynolds Community College
> > Phone:804.523.5323
> > Email: mhan...@reynolds.edu
> >
>


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Laura Robbins
Hi Mary,

Here's an asp script that I used to use to display our hours (
http://library.dowling.edu).  It has a feature to allow for predefined
closures.  It just needs to be called via javascript from the page you wish
to use it on.  We used to have a IIS server, but have recently changed over
to a linux one.  So, I had to rewrite it as php, but this always worked
reliably.

Take care,

Laura Pope Robbins
Dowling College


On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
wrote:

> Hi All,
>
> I know this has been covered a bit here, but I have a rather exigent
> conundrum, and I'm hoping to figure out the best/easiest solution.
> Yesterday, the script to hour library hours (on our front page) which pulls
> from Google calendar stopped working ("Error at line undefined in
> undefined[!]" - the exclamation point is mine; it seemed like it needed
> one.)
>
> Basically, the code came from a site that walked one through how to call
> daily hours (javascript) using Google's V2 API, but the V2 is fully
> deprecated (as I abruptly discovered), and I need to figure out another
> solution.  (I haven't been able to find similar documentation for V3's API.)
>
> Some constraints: 1. Our IT will not support php.We are an .NET shop
> with IIS servers.  2. We may not have the dough to pay for something like
> LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> "Internets/webmaster" thing, and really only know front-end coding, so a
> solution involving something like .NET, Python, etc. would have to have,
> "How to make a peanut butter sandwich," kind of documentation.
>
> Right now, I've just manually coded our hours, which is fine until
> Saturday when our hours change, and I'm not here (hopefully).  I will be
> super grateful for insight or knowledge.
>
> Mary.
>
> Mary Hanlin
> Electronic Resources and Web Librarian
> J. Sargeant Reynolds Community College
> Phone:804.523.5323
> Email: mhan...@reynolds.edu
>


hours2.asp
Description: Binary data


Re: [CODE4LIB] Library Hours Fail

2014-11-18 Thread Nick Szydlowski
Hi Mary,

This is probably not the best solution, but it is easy.  The javascript
below gives you a week of hours and displays only the current day, so you
only have to update it when the weekly hours change.  This is what we use
on our site (http://www.bc.edu/schools/law/library.html).


Today's Library Hours:


var Sunday='10AM - 11:45PM';
var Monday = '7:30AM - 11:45PM';
var Tuesday = '7:30AM - 11:45PM';
var Wednesday = '7:30AM - 11:45PM';
var Thursday = '7:30AM - 11:45PM';
var Friday = '7:30AM - 10PM';
var Saturday = '9AM - 10PM';

 function Hours (n) {
   this.length = n;
   for (var i =1; i <= n; i++) {
 this[i] = ' '
   }
 }
hours = new Array(7);
hours[0] = Sunday
hours[1] = Monday
hours[2] = Tuesday
hours[3] = Wednesday
hours[4] = Thursday
hours[5] = Friday
hours[6] = Saturday
var currentdate = new Date();
var daynumber = currentdate.getDay();
document.write(hours[daynumber]);


Detailed
Listing of Hours

I hope that helps, even if its just a short-term solution.

Best,
Nick


Nick Szydlowski
Digital Initiatives and Scholarly Communication Librarian
Boston College Law School
617 552-4474

On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin 
wrote:

> Hi All,
>
> I know this has been covered a bit here, but I have a rather exigent
> conundrum, and I'm hoping to figure out the best/easiest solution.
> Yesterday, the script to hour library hours (on our front page) which pulls
> from Google calendar stopped working ("Error at line undefined in
> undefined[!]" - the exclamation point is mine; it seemed like it needed
> one.)
>
> Basically, the code came from a site that walked one through how to call
> daily hours (javascript) using Google's V2 API, but the V2 is fully
> deprecated (as I abruptly discovered), and I need to figure out another
> solution.  (I haven't been able to find similar documentation for V3's API.)
>
> Some constraints: 1. Our IT will not support php.We are an .NET shop
> with IIS servers.  2. We may not have the dough to pay for something like
> LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> "Internets/webmaster" thing, and really only know front-end coding, so a
> solution involving something like .NET, Python, etc. would have to have,
> "How to make a peanut butter sandwich," kind of documentation.
>
> Right now, I've just manually coded our hours, which is fine until
> Saturday when our hours change, and I'm not here (hopefully).  I will be
> super grateful for insight or knowledge.
>
> Mary.
>
> Mary Hanlin
> Electronic Resources and Web Librarian
> J. Sargeant Reynolds Community College
> Phone:804.523.5323
> Email: mhan...@reynolds.edu
>