ngrok is converting double quotes into """ within application/ld+json - ngrok

I'm attempting to test some structured data using Google's Rich Results Test and Schema.org's Markup Validator.
Since I'm developing a Next.js site at localhost, I'm attempting to use ngrok so Google has access to the dev site, as if it were a live site.
However, the site which is accessible through ngrok is reformatting all JSON within each <script type="application/ld+json">, turning each " into ", which results in parsing errors within the validators.
Is there a way to retain the original formatting?
Thanks

Related

Error: The URL does not use a recognized protocol

We are launching a HP UFT test about the urls contained in a web application. We are trying to verify if the links are broken or not. We have a list of links stored in a excel file and we run a for loop to pass each urls to the function TestPageLinks. The following codes is out current function, but we are getting error "The URL does not use a recognized protocol." Anyone has ideas what may go wrong?
P.S We tried some urls hosted on public protocols like google.com and youtube.com and they all worked. But we have to make it work on the urls in our own web app.
Test Function:
Reporting:
The protocol of a link is the part before the ://.
http://example.com
https://google.com
ftp://somesite.com
Do your links include this part?

Making a Google API key work with requests from localhost [duplicate]

This question already has answers here:
Googlemaps API Key for Localhost
(10 answers)
Closed 2 years ago.
I am running a copy of the website that I am working on, using a server that runs on localhost:8759. The website uses Google's address autocomplete capability. I have a script element at the bottom of the page with a URL of https://maps.googleapis.com/maps/api/js?key=XXXXXX&libraries=places, with an actual API key in place of the XXXXXX. The API key is restricted so it can only be used from our production and testing servers.
I would like it to work on localhost instead. Initially, I tried running the website on localhost, and the autocomplete didn't work. I saw an error on my console saying Google Maps API error: RefererNotAllowedMapError.
I went to Google's Developer Console, added localhost:8759/* to the list of referrers, and waited over 5 minutes as recommended by Google. The autocomplete still didn't work. I saw an error saying This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console.
I tried adding a key with no restrictions and using it. The autocomplete still didn't work. I got an error like the one mentioned in the previous paragraph.
The autocomplete works fine when it is on a page coming from our testing server (which has an IP address in the list of referrers) or production (which has a domain in the list of referrers), but I can't make it work on localhost.
How can I make it work?
In my experience omitting slashes and protocol but including port seems to work:
Eg: localhost:5000 or localhost:8759 in your case

How would you go about writing a custom script that grabs the Adobe or Google Analytics image request?

If I wanted to build a scraper that pings each URL on a site and stores the adobe (or Google) image request, how would I go about this? I.e. I just want something that grabs all the parameters in the URL posted to Adobe in a csv or something similar. I'm familiar with how to build simple web scrapers, but how do I grab the URL I see in for example Fiddler that contains all the variables being sent to the Analytics solution?
If I could do this I could run a script that lists all URLs with the corresponding tracking events that are being fired and it would make QAing much more manageable.
You should be able to query the DOM for the image object created by the tag request. I am more familiar with the IBM Digital Analytics (Coremetrics) platform and you can find the tag requests using accessing the following array document.cmTagCtl.cTI in the Web Console on a Coremetrics tagged page. I used this method when building a Selenium WebDriver test case and wanted to test for the analytics tags.
I don't have the equivalent for Adobe or GA at the moment since it depends in the library implementation am trying the do the same as you for GA.
Cheers,
Jamie

Correct redirect URI for Google API and OAuth 2.0

I am making an application with the Google Maps API. I want to be able to have one person on a computer, watch what another person has edited to a map. I am thinking of passing information of the map to a Google Fusion Table. The other person will be able to see everything as a layer. I would like for the program to just run from the user's browser and not build a website for it.
To edit the fusion tables, I need to gain access/tokens. I am currently trying to use these there JavaScript to accomplish this. ScriptSample.html, oauthWindow.html, and gwt-oauth2.js. This is the working example.
When I run them, I get am error that says the redirect URI is incorrect. It says the file I use to redirect does not have authority. My first obvious question is:
How do I give that file authority to redirect?
In my API console, I have it set up as a client-side web application. Should I change it to an installed application?
Currently I have the following settings:
my JavaScript origin is: https://localhost
redirect URI: https://localhost/oauthWindow.html
Thanks
There's no problem with using a localhost url for Dev work - obviously it needs to be changed when it comes to production.
You need to go here:
https://developers.google.com/accounts/docs/OAuth2
and then follow the link for the API Console - link's in the Basic Steps section. When you've filled out the new application form you'll be asked to provide a redirect Url. Put in the page you want to go to once access has been granted.
When forming the Google oAuth Url - you need to include the redirect url - it has to be an exact match or you'll have problems. It also needs to be UrlEncoded.

Rss and external feed

I want to build a similar app like this:http://community.livejournal.com/ohnotheydidnt/32551171.html
using a livejournal rss feed. Any way of retrieving an external feed ( meaning getting a feed from a different domain that the one your web application-Same origin policy)? I've built a parser, but I would like to use dashcode for simple html building.
Across domains, if the data is only available via RSS and you don't have control of the other domain, then your best option is a server-side proxy.
If you have control over the other domain, you can create a page containing a javascript function which uses XmlHttpRequest to pull the RSS and returns the RSS. Then you can use a cross-domain messaging library like EasyXDM to call that script.
You also might want to check if the RSS feed's website supports JSONP as an alternate format, which would allow you to get the RSS data via javascript. Make sure you trust the site if you do this, though, since the site can execute javascript inside your page!

Resources