Single Line Address for MapQuest - mapquest

I'm trying to provide other map options besides just Google. Unfortunately a single HTTP query (e.g. location=123+main+street) only seems to be readily supported by Google.
I had no luck trying to find anything about embedding in the documentation and decided to email them directly:
The MapQuest business products
(https://developer.mapquest.com/documentation/) support both single
line input "location=1555+Blake+St+Denver+CO+80202+US" and the
advanced, 5-box method
("street=1555+Blake+St&city=Denver&state=CO&postalCode=80202&country=US").
Our API and SDK also lets you add the mapping/geocoding/routing
functions to your site without embedding links to the consumer site at
www.MapQuest.com.
Okay, so location=123+main+street should be supported in theory. However no example was provided. So using the iframe URL from the more client-oriented approach I tried the following without luck:
https://www.mapquest.com/embed/?location=1555+Blake+St+Denver+CO+80202+US
That just shows the map of the US as a whole.
How do I get the single HTTP query location to work for MapQuest embedding?
Correct: location=1555+Blake+St+Denver+CO+80202+US (single HTTP query).
Incorrect: street=1555+Blake+St&city=Denver (multiple HTTP queries).

It looks like a mix of MapQuest APIs and MapQuest.com. Check out the Link to MapQuest documentation. I think the Map a Location > Fielded Location is what you're after.

On this page: https://developer.mapquest.com/documentation/tools/link-to-mapquest/
Scroll down to Link to MapQuest Wizard.
Click on Map a Location.
Click on Single Line Location.
Click on the Run Sample with Embed View Specifier button.
Copy the URL from the new tab.
An example of the working MapQuest single HTTP query embedded page:
https://www.mapquest.com/embed/search/results?query=1555%20Blake%20St%20Denver%20CO%2080202&centerOnResults=1

Related

Is it possible to create a canonical URL for pages with just a pageid in confluence?

I need to groups each space in the Piwik web analytics software. The cleanest way to do it would be if all URL´s had the spacekey in it, to allow each space-owner to easily get a complete view of their space and retain all functionality like browsing the site with an analytics overlay.
Some URL´s are canonical, however some just have an URL like /pages/viewpage.action?pageId=199921170
Is there some way through the AJS API or other method to find force a working URL in the form: /display/spacekey/title-of-page
The most important part is to have the spacekey in the URL. If there´s no workaround I might just generate an invalid URL by inserting spacekey and let each space-owner fix their page-titles if they want working analytics :-)
We are running Confluence version 5.10.7
(There´s an unresolved open issue on https://jira.atlassian.com/browse/CONF-11285 concerning the broader issue of sometimes having ugly URLs in confluence)
Instead of adding an incorrect URL, you could use a custom variable to record the space key, e.g.
_paq.push(['setCustomVariable','1','Space Key', AJS.params.spaceKey]);

Embed API demo not working

I tried using this Google Analytics Embed API Demo, of course with my own ClientID (49803909):
Embed API Demo
However, instead of the graphic I should be getting, I only get a blank page. I did follow the instructions quite carefully. Does this work for others? Any ideas of what may be wrong?
PS: Here's the screenshot of where I am getting the id from. #DaImTo was right that just 49803909 wasn't it, but I also tried to full long string and even the service id below (the one with #), all to the same effect (a blank screen). So, is this the wrong screen then?
I think #DalmTo is correct. You're most likely using one of the many other Google Analytics IDs instead of using a valid Client ID (which is not Google Analytics-specific, it's a general ID used for accessing Google APIs), and you're probably getting errors logged to the JavaScript console that say something to that affect.
If you follow the steps in this Embed API Developer Guide, you'll see instructions on how to create a Client ID to use with the Embed API.

Bing maps pushpins in REST

I am using bing maps REST services and I need to add pushpins but surprisingly it's giving me a hard time. I found out how to easily add pushpins in AJAX services, but that would need me to include scripts and stuff to my pages which I'd really rather skip. I tried searching the internet for information on how to add pushpins in REST ( or simply an iframe with a URL ) but I failed to find any useful such. Does anyone know how I can add pushpins in REST?
EDIT: I'm using dynamic maps based on this link http://www.bing.com/maps/embed/viewer.aspx?showCopyright=false&cp=43.835109710693~25.957630157471&lvl=1&w=250&h=350&sty=r
Assuming that you are using the Bing Maps Imagery REST service, you will be able to add pushpin based on the URL parameters, see the MSDN: http://msdn.microsoft.com/en-us/library/ff701724.aspx
Here is an sample request that will allow you to add pushpins, take a look at the pp parameter:
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-122.351485;;AB&pp=47.616295,-122.3556;22&key=BingMapsKey
If you are using embedded maps, here is the list of parameters: http://msdn.microsoft.com/en-us/library/ee692180.aspx

I need a (preferably javascript) example of Google Url shortener Api

I'm working on a 'Place your Marker and get its URL' function for a Google Maps Page.
The URLs produced are similar to :
http://www.fuerteventura-maps.com/marker11.html?=28.4234731,%20-14.014550299999996=14=Sample%20Marker=roadmap
I'd like to somehow have the URL automatically shortened using the Google URL Shortener so that the URL the user needs to copy is just:
http://goo.gl/ZEQ7u
I've looked at the documentation but it assumes greater knowledge than I possess. Unlike the Maps Api documentation there are no simple examples for me to adapt.
Can anyone point me to a simple Google URL Shortener demo please?
'Twas a little bit of a struggle for me but this page gave me something to download and work with.
I've now got exactly what I was after:
Url shortener demo
(At first I was getting errors so I emailed the author - Tom McFarlin . and within an hour he had replied and corrected the fault in his code. Thanks Tom.)
The current samples provided by Google show only how to expand a shortened URL.
What you're looking for can be found here.
The problem, as the blogger points out is,
"If you follow the documentation on the insert method, (the method for getting a shortened url from a long one), there is a reference to a rather nebuluos Url resource required argument. It's not at all clear how to create one of these in Javascript."

Facebook Graph API SEO Comments and Profanity Filter

I'm trying to integrate the Facebook comments left on our site in a way in which the content can be crawled by search engines and also for people (although I highly doubt there will be many) who don't have Javascript enabled on their browser.
Currently our Facebook comments are displayed via the use of the Facebook comment social plugin (using the <fb:comments href="MY_URL" num_posts="50" width="665"></fb:comments> tag). This ends up rendering an iFrame (which are mostly ignored by search engine crawlers) so the plan is to render this information and format it with basic HTML. To do this, the comments are pulled using the Graph API - this is then only be displayed to crawlers and people with Javascript disabled.
This all works nicely using the Graph API call (https://graph.facebook.com/comments/?ids=MY_URL), parsing the JSON result and displaying it on the page. The problem is that the <fb:comments> approach filters our results based on a blacklist we have set up on one of our Facebook Apps. The AppId with the relevant blacklist is stored on the page using metadata (<meta property="fb:app_id" content="APP_ID"/>) which the <fb:comments> control obviously must somehow use to filter the comments.
The problem is the Graph API method does not filter any results as I guess no blacklist (or App Id containing a blacklist) is specified. Does anyone know how to specify a Facebook App ID to the API call URL or of another way to not fetch commnents back that violate the terms of the blacklist?
On a side note, I know the debate about filtering content in comments rages on but it is a management decision to implement the blacklist, and one that I have no influence in changing - just incase anyone felt the need to explain the reasons why content filtering is or isn't a good idea!
Any thoughts on a solution?
Unfortunately there's no way to access a filtered list of comments using the API - it might be a reasonably request to have this in the API - you should file a wishlist item in Facebook's bug tracker
Otherwise, the only solution I can think of is to implement your own filter on your side when retrieving and displaying the comments from the API.
According to the Comments plugin documentation the filter on Facebook's side is implemented as a simple substring match, so it should be trivial to implement.
A fairly simple regular expression match should be able to check each comment against a relatively long list quickly.
(Unfortunately, the tradeoff here is that implementing a filter is easy, but you'd also need to write an interface so that whoever's updating the list of disallowed words can maintain the list for both the Facebook plugin, and your own filtering.)
Quote from docs:
The comment is checked via substring matching. This means if you blacklist the
word 'at', if the comment contains the sequence 'a' 't' anywhere it will be
marked with limited visibility; e.g. if the comment contained the words 'bat',
'hat', 'attend', etc it would be caught.
Pretty sure there is no current way of doing this from the graph API, the only thing I can suggest is taking the blacklist and build your own filter