arrayForEach was called with a non array value. Google Calendar - javascript

I am trying to get events from my Calendar. I walked through all tutorials and searched through internet, but it seems like i am the only one who get the error. My calendar oppened for everyone. ClientId, Api key, DISCOVERY_DOCS and SCOPES are correct, because i purposly made them wrong to check. Also i tried to change calendarId from 'primary' to actual calendar id, which is my email address. Same story. I am signed in and approved, so it is not the problem for sure. There are events in my Calendar, so it should have an array anyway. Looks like it doesn't get the array on some part of code and it is not possible for me to debug it step by step. At this point i completely don't understand what is wrong.
So the code straight from this tutorial JavaScript Google Calendar, only CLIENT_ID and API_KEY changed, and there is no point inserting the same code here i guess.

I have the same problem when using visual studio with .net core. I found a problem with the file "browser-sync-client.js". I blocked the request to this file and it worked. So I change to use pure HTML,js without the visual studio.

I had the same issue since I upgraded to VisualStudio 2022, I don't know if it's usefull. I didn't understand how to fix it yet.

Related

Is it possible to use Google Places Autocomplete Service in a managed Expo app?

I've been scouring the web and I've found several posts that almost seem to address my issue, but none that I've found seem to get it quite right. I'm developing an app in Expo using the managed workflow, and all I want is a simple input component that will suggest/autocomplete names of cities/towns as the user types. The Google Places API has their Place Autocomplete, and the AutocompleteServices class seems to be a way to handle this without a prebuild UI component (as their components expect basic HTML elements).
The trouble is: The only way to import this library seems to be with a <script> tag, and it's my understanding (please current my if I'm wrong because I am comploetely new to mobile development), that you can't simply put an HTML script tag on a "page" in React Native/Expo.
I've been looking into solutions via NPM packages, but the best solution I've found - "react-native-google-places-autocomplete" - uses the Autocomplete query request instead of the basic request. The problem here is that the query form of the request doesn't allow you to filter by place type. (I need to list only cities/towns, which can only be done with the bbasic Autocomplete request, as far as I can tell).
So, basically, all I want is access to the library so I can build what I need myself, but every instruction I've found for importing it assumes you can use a <script> tag in an HTML document.
I thought what I wanted to do was simple, but apparently not? Is there something I'm overlooking (i.e. no one has mentioned it because it's so simple)? Should I just go use GeoDB instead? (I'd really like to use Google Maps if possible, as the app will need more complex location-based functionality later down the road).
Any tips would be greatly appreciated!

Changing DOM based on Google Calendar resource availablity

Thanks for any help that you provide in advance! I've been learning to code for the last year, and I'm actively building my first app.
I'm using: - Front End: HTML, CSS, Bootstrap (with MDBootstrap add-on), jQuery - Back End: Node.JS (with Express, Passport, Cookie-session) and MongoDB
My question I believe is relatively simple, but I just haven't been able to piece together what I need to build to realise my vision for this app. Although the front end is more complex, the fundamental functionality of this app is to authenticate users (using Google Sign-in) and then display either RED or GREEN based on a shared Google Calendar's event data.
On the Back End, I'm authenticating users then pulling their Google profile data. Authenticating using Google gives me access to an AccessToken and a RefreshToken. Everything up to this point is fine and seems to work well (at least for a first attempt).
Anyway, the problem is getting access to the private (shared between colleagues) Calendar Event data on the Front End so I can set up logic to choose what is displayed to the user. I can't seem to be able to make an API call because I need the Access Token/Refresh Token on the Front End and I can't see how I can pass that data through. I assume that because the code for the API call is on the Front End, this might not be the best way to go about this?
I'm partial to stripping down the app and starting again, but I don't know if what I've built so far is already on the right path, or if I need to follow a different path altogether? Really all I'm looking for is a guidance on a structure/path that I should follow to get this done as I'm lacking a lot of direction at the moment.
I'd really appreciate anyones help here.
Thanks all

Retrieve Outlook calendar info in JavaScript/JQuery

I'm trying to write a web page for a musician friend. I want to get gig info from her Outlook calendar so I can put it on the page. I've been going in circles all day trying to find the right way to do this. Some info is out of date. Some tell me to do things that don't exist. Etc.
All I need to do is read info, probably from a specific "gigs" calendar, or even from her default. I will never have to write info or access anything else. I've created my own outlook calendar to play with, but am stuck cold.
It's seems to me that there should be some simple AJAX call that could do this (so I can manipulate it with JS), but I can't find one that works. Please tell me what I'm doing wrong or point me in the right direction.
If that can't be done, I'd at least like to be able to embed an Outlook calendar on the page. I did something similar years ago with a google calendar and that was easy. Now, I keep getting told I have to go get a link, but I follow the directions and there is no link.
Pretty sure you can export to CSV from Outlook and use something like this CSVToArray(); method.

Google Maps Error

I'm hoping someone has come across this problem also. I'm a newbie to all this, therefore excuse my lack of knowledge in advance.
I currently have Google Maps API setup on my wordpress site. When I perform a search on the site i.e. page containing Google Map, no listing results are been found. Upon further investigation I have been advised that:
there's a JS error on my website coming from Maps API. Chrome Dev Console shows:
js?key=++AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I+&libraries=places&ver=3b47f53……:34 InvalidValueError: setComponentRestrictions: not an Object
in source view of the page the google maps JS is called via this
https://maps.google.com/maps/api/js?key=++AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I+&libraries=places&ver=3b47f534942a304aaad0d1a98d2531f8
the part "&ver=3b47f534942a304aaad0d1a98d2531f8" shouldn't be there (it's added to each JS file), so we assume it must be coming from some plugin that I have that might be causing that issue.
Before I start disabling every plugin on my wordpress site, has anyone come across this error before?
Any help would be much appreciated.
Thanks,
Justin
OK - so apparently this was a bug introduced in the 3.27 release of Google Maps.
https://code.google.com/p/gmaps-api-issues/issues/detail?id=11253&q=setComponentRestrictions&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal
The Google team has it logged and is working on it.
In the meantime you can do as follows:
Thanks for the report! We have created an internal ticket to investigate this.
On the meantime, you can load JavaScript API version 3.26 to avoid getting this error.
UPDATE: It does not look like they plan on fixing this. So the correct fix would be to change your settings to:
autocomplete.setComponentRestrictions({'country': []});
I have the same problem, but I have changed to the version 3 and it has worked. Obviously, that it isn't the best way to correct it, but I can use this solution up to somebody publishes the correct fix.
Before
http://maps.googleapis.com/maps/api/js?key=[MyKey]&libraries=places
After
http://maps.googleapis.com/maps/api/js?key=[MyKey]&libraries=places&v=3
I just started noticing a similar error as well, InvalidValueError: setComponentRestrictions: in property country: not a string; and not an Array. It turns out I was passing an empty object, {}, as the componentRestrictions option when trying to initialize a Place Autocomplete.
It looks like that componentRestrictions option is used by the Google Maps API, you can read more about it here. I am assuming that Google recently made a change that throws an exception if it is configured wrong.
So in your particular case I imagine either you, or one of your plugins, is not setting componentRestrictions correctly.
Upgrade Google Maps to Version 3.28.

Unable to see complete scraped web page in Google Apps Script logs

A few weeks ago I started learning Javascript and the Google Apps Script API, specifically in regard to spreadsheets. I have been trying to make a spreadsheet that fetches web pages and pulls stats about my friends for the game League of Legends. However, I have been running into a problem with the site I want to use, which is basically the only free LoL stats site that updates frequently. I'm not familiar at all with web development, but it seems when I try to access a page on lolking.net, for example http://www.lolking.net/summoner/na/60783 with Google's UrlFetchApp.fetch() it does not load the dynamic page. So instead of the final source, I get this which doesn't help me. Is there an easy way around this or would I simply have to use another website?
Thanks for thie info! Although it turns out I was mistaken. The UrlFetchApp was indeed returning the full source code, but I was using GAS's Logger to view the text. It seems the Logger has a length limit, so when I searched for the stats I wanted they weren't there simply because the source code got truncated. So, due to an oversight on my part, I never had a problem in the first place. For other people reading this question, in the end I have no idea how UrlFetchApp works with dynamic pages using clientside js (you'd probably want to talk to the poster below or post a new question).
You are getting fhe raw html page with clientside js included. That wont work from any system not just gas. You need to debug that page js and find where it does an ajax call to get the data you want.
Then do the same from your gas. Might not work if the call is authenticated etc.

Categories

Resources