$(function() {
loadMetagRank();
});
function settingFirabaseMetags(){
let search = {
query: "where is facebook?",
results: 0
};
var metagsSearchFirebase = new Firebase(`https://seecoderun.firebaseio.com/test/-KhGIb91d_T3gIjfW5dq/metags/search`);
metagsSearchFirebase.push(search);
let result1 = {
ranking: 1,
url: "http://facebook.com",
title: "facebook",
description: "welcome to Facebook"
};
metagsSearchFirebase.orderByChild('query').equalTo('where is facebook?').on('child_added',
function child_added(snapshot) {
let data = snapshot.val();
if(!data.results){
data.results = [];
}
data.results.push(result1);
// metagsSearchFirebase.child("query").ref().update(data);
});
//template for the a DB value of a metagRanking
let ranking = 1; // ranking is determined by the page results.
let votes= 5019;
let userChoices = {favorited: true, pinned: false};
let metagRanking = { votes: votes, userChoices: userChoices};
// "metagRanking/votes" , "metagRanking/userChoices/favorited" and "metagRanking/userChoices/pinned"
let metagComments = {comment1: {
metagRanking: metagRanking,
text: "Hi Fardina!",
properties: {
blogSelected: true,
wikiSelected: false,
qaSelected: false,
apiSelected: false,
}
}
};
let pageURL = {url: "http://facebook.com", metagRanking: metagRanking};
var metagsURLFirebase = new Firebase(`https://seecoderun.firebaseio.com/test/-KhGIb91d_T3gIjfW5dq/metags/url`);
metagsURLFirebase.push(pageURL);
}
function loadMetagRank(){
// case 1: search query 1 --> search results 2 --> result(URL1) --> metag 1
// case 1: search query 2 --> search results 2--> result(URL1) --> metag 1
// assumption: urls appear only if search queries are related.
let metagsURLFirebase = new Firebase(`https://seecoderun.firebaseio.com/test/-KhGIb91d_T3gIjfW5dq/metags/url`);
let metagsURLFirebaseVote =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.