google api

ITsolutionWizard
ITsolutionWizard used Ask the Experts™
on
https://developers.google.com/calendar/quickstart/dotnet
I hope to get list of music concert event based on the zip codes
and I used above google api.

can you guide me how to filter just music event and zip?

I use c#
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
What you're asking will just require you jump in + start coding/experimenting.

1) The Google Calendar API will only allow you to access calendars.

2) If you point your code a various different calendars, which contain music events + addresses (zip codes) then you can pull this data.

3) Many of these calendar entries my have various formats, since calendar events are just structured text + many times the structure may not make sense. This means you'll likely be writing a lot of custom code to look through every line of the calendar entry looking for a zip code. For example, someone my put the address in a notes field or URL field or any other oddly named field. Best of you pull all text from the entire entry, then parse the entry looking for a 5x or 10x character zip code.

4) There is no... one size fits all... approach to writing this code. You'll just have to write the code + compare your parsing with actual events, to ensure you're pulling out data you require.

5) No matter what language you choose, you'll still likely use libcurl() for sites with APIs or RSS feeds or microdata.

6) For sites you must scrape, you'll use http://phantomjs.org/ to correctly pull data generated by Javascript.

Note: Be sure to check the TOS of sites you're accessing. Some sites will be happy for you to pull data. Other sites prohibit pulling data.

7) c# eh... This means your code will be very difficult to port. If it's important for your code to work forever + coding time be minimal, then use PERL or some other scripted language, geared toward handling strings.
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
I can't help with the specific C# code, however, in the api it shows how to find what you may be looking for https://developers.google.com/calendar/v3/reference/events/list  using "q" Free text search terms to find events that match these terms in any field, except for extended properties. Optional.

Are these events in a Google Calendar that you have access to? and what does the data from one event look like now?

Author

Commented:
thanks guys. my goal is to extract those events into my database. using c# or just JavaScript.
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
The response given in the api is json
{
  "kind": "calendar#events",
  "etag": etag,
  "summary": string,
  "description": string,
  "updated": datetime,
  "timeZone": string,
  "accessRole": string,
  "defaultReminders": [
    {
      "method": string,
      "minutes": integer
    }
  ],
  "nextPageToken": string,
  "nextSyncToken": string,
  "items": [
    events Resource
  ]
}

Open in new window


Your first step has two parts, a) get a token and b) call the specific api https://www.googleapis.com/calendar/v3/calendars/calendarId/events

Next, you will get a response of either an error or good data
{
  "kind": "calendar#events",
  "etag": etag,
  "summary": string,
  "description": string,
  "updated": datetime,
  "timeZone": string,
  "accessRole": string,
  "defaultReminders": [
    {
      "method": string,
      "minutes": integer
    }
  ],
  "nextPageToken": string,
  "nextSyncToken": string,
  "items": [
    events Resource
  ]
}

Open in new window

Your code will need to parse this and decide if it is good data or not to add to the database.

The final step is to ingest the json data and import it to your database.

Which step do you need more specific help with?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial