Trying to pull in Meetup events into Wordpress webpage

267 views
Skip to first unread message

Roy_Jackson

unread,
Apr 6, 2012, 8:22:30 PM4/6/12
to meetu...@googlegroups.com
Hi, I'm trying to pull in data from Meetup whereby it takes the information from Meetup and creates a new calendar event in a calendar plugin that I have installed on my Wordpress webpage.  Now, I know the code that I have is incorrect but I'm looking to see how you can help me better access and post this content on my site.  Thank you in advance for any assistance that you may be able to provide!!!

<html>
  <body>
    <h2>Upcoming Meetups</h2>
    <div id="event_listing">
      <p><em>Loading...</em></p>
    </div>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script>
    $(function() {
      var events = "http://api.meetup.com/2/events?group_urlname=NBBAlone&key=___&sign=true";
      var target = $("#event_listing");
      $.getJSON(events + "&callback=?", function(data) {
        target.empty();
        if (data.status && data.status.match(/^200/) == null) {
          target.append("<p><em>Service Unavailable</em></p>");
        } else {
        for (i in data.results) {
          ev = data.results[i ];
          target
          .append($("<h3>").append(ev.name))
          .append($("<h4>").append(ev.time))
          .append($("<div>").append(ev.description));
          }
        }
      });
    });
    </script>
  </body>
</html>

Doug Tangren

unread,
Apr 11, 2012, 2:26:06 PM4/11/12
to meetu...@googlegroups.com
Hi Roy,

Sorry for the late reply. The API calls looks right to me. Here is a cleaned up example: https://gist.github.com/249f880509a0ee8e7c1e. Note, if you were going to put this on a live site, you would want to replace the request url, with a signed version so you don't have to embed your API key on the client. Here's some more information on signed requests - http://www.meetup.com/meetup_api/auth/#keysign

--
You received this message because you are subscribed to the Google
Groups "Meetup API" group.
To unsubscribe from this group, send email to
meetup-api+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/meetup-api?hl=en?hl=en

Roy_Jackson

unread,
Apr 16, 2012, 9:53:41 AM4/16/12
to Meetup API
I think I got it...so the <script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js"></script> is the request url? Will
this need to be the signed Meetup API or are you referring to the link
where I would input my API (i.e., in the ____ space) in this link:
"http://api.meetup.com/2/events?
group_urlname=NBBAlone&key=___&sign=true"?

On Apr 11, 2:26 pm, Doug Tangren <d...@meetup.com> wrote:
> Hi Roy,
>
> Sorry for the late reply. The API calls looks right to me. Here is a
> cleaned up example:https://gist.github.com/249f880509a0ee8e7c1e. Note, if
> you were going to put this on a live site, you would want to replace the
> request url, with a signed version so you don't have to embed your API key
> on the client. Here's some more information on signed requests -http://www.meetup.com/meetup_api/auth/#keysign

Doug Tangren

unread,
Apr 16, 2012, 9:59:49 AM4/16/12
to meetu...@googlegroups.com
On Mon, Apr 16, 2012 at 9:53 AM, Roy_Jackson <lrog...@gmail.com> wrote:
I think I got it...so the <script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js
"></script> is the request url?  Will
this need to be the signed Meetup API or are you referring to the link
where I would input my API (i.e., in the ____ space) in this link:
"http://api.meetup.com/2/events?
group_urlname=NBBAlone&key=___&sign=true"?



You would want to sign the Meetup API request containing your private API key. The sign request parameter will generate that for you. You will find it in the meta response field.

Roy_Jackson

unread,
Apr 24, 2012, 12:17:17 PM4/24/12
to meetu...@googlegroups.com
This isn't working and I still get the "Loading..." in the test page of the site.  I've used the suggested cleaned up version of the code but that hasn't worked.  I have included my API key in there as well, as suggested.  Not sure I'm able to clearly say what I need to have happen...

Doug Tangren

unread,
Apr 24, 2012, 12:59:37 PM4/24/12
to meetu...@googlegroups.com
On Tue, Apr 24, 2012 at 12:17 PM, Roy_Jackson <lrog...@gmail.com> wrote:
This isn't working and I still get the "Loading..." in the test page of the site.  I've used the suggested cleaned up version of the code but that hasn't worked.  I have included my API key in there as well, as suggested.  Not sure I'm able to clearly say what I need to have happen...


Can you check your browsers console for javascript errors?

I just tried https://raw.github.com/gist/249f880509a0ee8e7c1e/f940225dd63a8fe4aa870a870b572a5435360b0c/events.html verbatim replacing the api key place holder with my own without an issue. It is possible you are being rate limited if you are going over your allotted limit.

If you don't see errors in your browsers console. Send me the exact code you are using with your api key to do...@meetup.com (not this list) and I will have a look.

 

On Monday, April 16, 2012 9:59:49 AM UTC-4, doug wrote:


On Mon, Apr 16, 2012 at 9:53 AM, Roy_Jackson <lrog...@gmail.com> wrote:
I think I got it...so the <script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js
"></script> is the request url?  Will
this need to be the signed Meetup API or are you referring to the link
where I would input my API (i.e., in the ____ space) in this link:
"http://api.meetup.com/2/events?
group_urlname=NBBAlone&key=___&sign=true"?



You would want to sign the Meetup API request containing your private API key. The sign request parameter will generate that for you. You will find it in the meta response field.

--

Roy_Jackson

unread,
Apr 24, 2012, 7:39:58 PM4/24/12
to meetu...@googlegroups.com

Hi Doug,

I checked the error console and noticed this error:

Doug Tangren

unread,
Apr 24, 2012, 8:39:14 PM4/24/12
to meetu...@googlegroups.com
It looks like those were converted to html entities in what ever client you cut and pasted them from. Try removing those and replacing with two ampersands (&)

--

Roy_Jackson

unread,
Apr 24, 2012, 10:00:34 PM4/24/12
to meetu...@googlegroups.com
In the html in the wordpress console, there are two ampersands there.  However, when I save the draft and preview the page, the ampersands append the 038; to the tail end.  I have taken out the extra spaces too but that didn't work because I got the same error.  If I removed the data.status, another error pops up in the target.append("<p>...) space.  Is this normal or am I missing something?

Doug Tangren

unread,
Apr 24, 2012, 10:28:07 PM4/24/12
to meetu...@googlegroups.com
On Tue, Apr 24, 2012 at 10:00 PM, Roy_Jackson <lrog...@gmail.com> wrote:
In the html in the wordpress console, there are two ampersands there.  However, when I save the draft and preview the page, the ampersands append the 038; to the tail end.  I have taken out the extra spaces too but that didn't work because I got the same error.  If I removed the data.status, another error pops up in the target.append("<p>...) space.  Is this normal or am I missing something?


I'm not familiar with wordpress's templating system but it sounds like it's converting those ampersands to html entities thinking your javascript is renderable content. Try wrapping the javascript content (within the script tags) in these CDATA declarations. This should tell wordpress or whatever html render to leave the content inside alone

<script>
<![CDATA[

(javascript here)

]]>
</script>

 
Reply all
Reply to author
Forward
0 new messages