Closed
Bug 1278677
Opened 9 years ago
Closed 9 years ago
Use Embed.ly for temporary metadata collection
Categories
(Hello (Loop) :: General, defect, P1)
Hello (Loop)
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ianbicking, Assigned: mancas)
References
Details
(Whiteboard: [akita-alpha])
Attachments
(2 files)
Until we get some of the other metadata stuff fully stood up, it will be nice to see a table of contents with some good data in it.
The easiest way is to use the Embed.ly API to get some data. This should be done on PAGE ADD TIME (not at ToC render time). You'll make a request to:
GET https://api.embedly.com/1/extract?url={url}&key={api_key}
API key has been provided to some people on the team via email.
I propose we hardcode the API key in the client for now. It has a fairly low limit (5000 requests per month), but this is a very temporary approach.
Note then that when you add a page you'll do something like:
function getPageMetadata(url) {
return new Promise((resolve, reject) => {
let result = {url: url};
let req = new XMLHttpRequest();
req.open("GET", `https://api.embedly.com/1/extract?url=${encodeURIComponent(url)}&key=${encodeURIComponent(api_key)}`);
req.onload = function () {
if (req.status != 200) {
reject(req);
return;
}
let extracted = JSON.parse(req.responseText);
result.title = extracted.title;
result.images = extracted.images;
result.favicon_url = extracted.favicon_url;
//maybe result.embedly = extracted ?
resolve(result);
};
});
}
Docs are here: http://docs.embed.ly/docs/extract
The .images property is fairly rich, and some stuff (like entropy) we're unlikely to do ourselves, but we can keep it for now.
| Reporter | ||
Updated•9 years ago
|
Rank: 11
Priority: -- → P1
Whiteboard: [akita-alpha]
| Reporter | ||
Updated•9 years ago
|
Blocks: akita-london-demo
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → b.mcb
Status: NEW → ASSIGNED
Comment 1•9 years ago
|
||
| Assignee | ||
Updated•9 years ago
|
Attachment #8761121 -
Flags: review?(standard8)
Attachment #8761121 -
Flags: review?(fernando.campo)
Attachment #8761121 -
Flags: review?(edilee)
Attachment #8761121 -
Flags: review?(dmose)
Comment 2•9 years ago
|
||
Comment on attachment 8761121 [details] [review]
[loop] mancas:bug1278677 > mozilla:akita
left couple of questions on GH. code looks good, needs error treatment and tests.
Or maybe we can avoid it, being a temporary solution and close deadline (although I'm afraid we will forget about it when exchanging for final solution if we don't make them now)
Attachment #8761121 -
Flags: review?(fernando.campo) → feedback+
Comment 3•9 years ago
|
||
Ian -- if I read this correctly, we are planning to send every URL visited by Hello users to embedly as they visit them. Is this right?
Flags: needinfo?(ianb)
Comment 4•9 years ago
|
||
(In reply to Adam Roach [:abr] from comment #3)
> Ian -- if I read this correctly, we are planning to send every URL visited
> by Hello users to embedly as they visit them. Is this right?
That's correct, however this is temporary on our Akita branch and only going to be used for demos/initial development - it won't be released to users (for which we're planning alternate options).
Flags: needinfo?(ianb)
Updated•9 years ago
|
Comment 5•9 years ago
|
||
I'd say just add an XXXakita comment with a bug number for writing the tests and error handling.
Comment 6•9 years ago
|
||
Comment on attachment 8761121 [details] [review]
[loop] mancas:bug1278677 > mozilla:akita
At this point, this wants Fernando's questions answered and probably just a spin-off bug filed before a final review/landing.
Attachment #8761121 -
Flags: review?(standard8)
Attachment #8761121 -
Flags: review?(edilee)
Attachment #8761121 -
Flags: review?(dmose)
| Assignee | ||
Updated•9 years ago
|
Attachment #8761121 -
Flags: review?(fernando.campo)
| Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8761515 -
Flags: ui-review?(b.pmm)
Comment 8•9 years ago
|
||
Comment on attachment 8761121 [details] [review]
[loop] mancas:bug1278677 > mozilla:akita
Thanks for adding the error handling.
And cool feature with the snackbar :) Let's wait for UX approval before merging it
Attachment #8761121 -
Flags: review?(fernando.campo) → review+
Comment 9•9 years ago
|
||
Comment on attachment 8761515 [details]
Snackbar demo
It's a good start. Thanks, Manu!
Attachment #8761515 -
Flags: ui-review?(b.pmm) → ui-review+
| Assignee | ||
Comment 10•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•