how does GitHub support oembed? - github

how does GitHub support oembed?
According to this old gist
https://gist.github.com/skabber/54099
// URL scheme: http://gist.github.com/*
// API endpoint: http://gist.github.com/services/oembed/
// Example call: http://gist.github.com/services/oembed/?url=http%3A//gist.github.com/54099
But that unfortunately does not work. (I get http 404)
Now I know GitHub allows oembed because I can embed snippets in articles on medium.com
can somebody show me the URLs that I need to access GitHub Oembed services ?
p.s.
Just to help: had I asked the question for Flick instead of GitHub this URL would have been just the correct answer:
http://www.flickr.com/services/oembed/?format=json&url=http%3A//www.flickr.com/photos/bees/2341623661/
p.s. II
if somebody wonders why I am after this, it's because I want to see the JSON response provided by GitHub

GitHub does not provide oEmbed support for it's url. You can test with this oEmbed tester which tells you that the site is not oEmbed supported.
Medium doesn't unfurls its content with the help of oEmbed meta. It just takes the snapshot of the content (which would be displayed when opening the same url content in browser). Try the same by embedding a google doc content. You could get a clear picture of what medium does.
Medium uses embed.ly which is a api provider which provides embed content which could be easily added to your site.

Related

Given a facebook staging_resources image URI, how do I get out a usable URL?

I can successfully upload a png to FB's staging resources via the graph API: https://developers.facebook.com/docs/sharing/opengraph/object-api#objectapi-images-staging. This returns a URI of the form fbstaging://graph.facebook.com/staging_resources/XXX. The docs say:
Although this is a URI, it's for internal use only and is only a way to pass around an identifier. Referencing it as if it were an image will not return any useful data.
I'd like to use the staged image in a share dialog for the user, but for this I need a URL. When I pass the URI to ShareLink's image param (I'm using Unity's 7.2.2 FB plugin in Unity 5.2.4 but I think this is a generic issue?) I get an error because it expects image URLs to start with http:// or https://.
Is there a way to get the URL from this staging URI? The docs are unclear.
(You can phrase your answer in terms of the graph API explorer, I don't need a C# or Unity-specific answer)

How to publish an action with tagged Google Places (or Maps)?

I'm having problem publishing actions (using OpenGraph) with tagged Google Places instead of Facebook Place. It should be straight forward according to the following document:
https://developers.facebook.com/docs/opengraph/location_tagging/#third_party
But every time I try to publish an action with place=http://GOOGLE_PLACE_URL I get the following error message:
The action you're trying to publish is invalid because the specified place 'http://GOOGLE_PLACE_URL' is invalid.
I've tried to put Google Maps, Google Places and Google+ Local URLs but all with the same problem.
Note: I could successfully publish actions when I set "place=Facebook_Place_ID".
Any help or hint is greatly appreciated!
Thank you,
I don't think Google's place pages have the markup necessary to support Open Graph
From the documentation:
Publishing actions with 3rd party places is similar to the location
tagging example above, except that you will pass in the url to another
site's place object.
The foursquare example in the documentation is defined as a place, as well as having the metadata foursquare uses:
https://foursquare.com/v/eataly/4c5ef77bfff99c74eda954d3
See Facebook's Debug Tool for that URL at https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Ffoursquare.com%2Fv%2Feataly%2F4c5ef77bfff99c74eda954d3 - it clearly shows that foursquare's place is defined as ‎og:type‎ playfoursquare:venue and has location data available for Facebook - i suspect Google does not have this on their place pages

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."

Meaning of referer param fb_source=games_ego

I see many people coming to my facebook game with HTTP referer that includes
fb_source=games_ego
Previously all options were at
http://fbdevwiki.com/index.php?title=Ref&cb=7347
but "games_ego" is something new.
What could it mean?
It's new section "Discover New Games" in the right block which is shown only in games.
Official Facebook documentation:
https://developers.facebook.com/docs/games/services/measurement#referraltracking
I don't know if they just changed it, but I only see "fb_source=ego". I updated the wiki.
Also, on the wiki there's a link to where Facebook has documented the possible values.

How does facebook's Share a link feature work?

I'm trying to implement a feature like that where a user inputs a url and when displaying that url I want to have a custom display (an embed object if it's a video from youtube, a thumbnail if it's an image link, title and excerpt of body if it's a normal link).
How can such a feature be realized?
There is a new idea called oEmbed that a few sites support (Flickr, Vimeo and a few others) that addresses this problem. oEmbed site
Otherwise, just check the site against a list of ones you pick and then pull out the relevant bits to construct an embed link.
I liked the idea of oEmbed a lot but unfortunately it doesn't has that much adoption yet.
oohEmbed tries to solve this issue by building oEmbed for many websites.
For the feature to work, it needs the server's interaction where I believe the following scenario is how it works
Assume that we have the site humanzz.com and that it provides such feature
A user enters a url on the humanzz.com's webpage and presses a button like facebooks' preview button
An AJAX call is made to a dedicated page on humanzz.com
humanzz.com does calls the remote website and gets its data
The AJAX call now returns the page's data (oEmbed JSON object)
This involves so much server's overhead.
I really wanted to do it using JavaScript as the server's role was only to bypass "Same Origin Policy"'s restrictions.
oohEmbed allows bypassing the server's step by specifying a callback parameter to oohEmbed so that the JSON object returned is passed to a callback function on your page.
An example illustrating this is as follows
Add a script tag dynamically to your page
< script type="text/javascript" src="http://oohembed.com/oohembed/?url=http%3A//www.amazon.com/Myths-Innovation-Scott-Berkun/dp/0596527055/&callback=myCallBack">< /script>
This would result in executing myCallback(oEmbedJSONObject) which is great.
The problem with that solution is you still have to have a fallback for websites that don't have oEmbed representations.
For the embedded things, I have been using auto_html ( https://github.com/dejan/auto_html) with great success (vimeo, youtube, images) and even added soundcloud myself. But I am still looking for a "thumbnail" generation with an image and text facebook-like.
I guess you have to construct it by yourself by manually parsing the kind of URL you get.
If it is an image url, well then you just have to rescale it and in case the user clicks on it, then handle that by opening the original one somehow.
If it is a link to some youtube video, then you have to take a look at how the embedding of Youtube videos works. You can just copy the code that is provided by Youtube itself, and then exchange the parts with the URL to the video with the URL you got from your user.
I did never implement something like that, but I assume it should work somehow like this.