CSS

Wednesday, June 12, 2013

Bookmarklets Collection

What are Bookmarklets?

A bookmarklet is a useful bit of javascript code stored in a bookmark, used like a tool on a toolbar. You can click a bookmarklet to do important things like: highlight search terms, look information up, block ads or auto invite all your facebook friend to your group.

Google Chrome.
Press [Ctrl][Shift][B] to bring down your Google Chrome bookmark bar.
Drag-and-drop the bookmarklet links below into your bookmark bar, or Other bookmarks folder.
You are done! Now, when you visit a page, just click on the bookmarklet you want to use.
Firefox.
Press [Ctrl][B] to show your Firefox bookmark panel.
Drag-and-drop the bookmarklet links below into your bookmark bar.
You are done! Now, when you visit a page, just click on the bookmarklet you want to use. Works just like toolbar but without slowing down the browser.
  • Get FB Apps Access Token
    Drag the bookmarklet link above into your bookmark bar, Go to https://www.facebook.com/ and then click the bookmarklet to open the interface. Watch the video at http://youtu.be/Hl_C5C35DK4
  • Facebook Emoji Clickboard
    Drag the bookmarklet link above into your bookmark bar, Go to http://www.facebook.com/ and then click the bookmarklet to open the Emoji Clickboard interface. Click on a comment box at any post and press spacebar or type any word, click/choose on one of the emoji and you'll see a square character inserted into the comment box, press enter and after the comment submitted you'll see your comment has an emoji sign or Watch the video at http://youtu.be/pbiDReAurCU
  • Group Invite + Confirm Friends Requests + Remove Friends ( 3 in 1 )
    Drag the bookmarklet link above into your bookmark bar, Go to your Facebook Group page, and then click the bookmarklet to invite all your friends into that group.
  • Easy Groups Leave Out
    Drag the bookmarklet link above into your bookmark bar, Go to http://www.facebook.com/groups/ and then click the bookmarklet, there'll be options to select all groups you want to leave or select them one by one. Watch the video at ..in progress..
  • Index of Folder to URLs
    It will lot more easier to explain this with an example. So try this: Drag the bookmarklet link above into your bookmark bar, Go to Click this link for an example, and then click the bookmarklet. Now you have the full links listed :D you may Select All those links and then upload to your new facebook album using Facebook Photo upFlood :P
  • Confirm Group Members Group Admins Only
    Drag the bookmarklet link above into your bookmark bar, Go to http://www.facebook.com/groups/Your_Group_UserName/requests/ and then click the bookmarklet to confirm all the memmber requests, or Watch the video at http://youtu.be/n164UKrgppA

Bikin Notif Pengunjung ala Facebook diBlog (versi Google Script)

Udah gak usah dijelasin lagi kali kayanya ya, noh tuh kan contonya (kalo masih) ada dipojok kiri bawah.

Dulu di Blog yang lama juga udah pernah dishare scriptnya kalo gak salah, tapi emang yang itu DataBase untuk penyimpanan data pengunjung-nya masih pake Feed dari Facebook Page, nah kalo yang sekarang udah dipindah pake ScriptDB-nya Google Script.

Sebenernya kalo dibilang beda juga gak jauh-jauh amat kayanya, antara nyimpen sama ngambil datanya juga tetep pake API, cuman emang kalo ScriptDB-nya Google Script gak butuh Access_token, tapi kalo soal privacy data sih tetep aja public open; semua orang bisa access read/write.

Ada beberapa yang masih jadi ganjelan dari Blog Notif yang sekarang ini:
  • Apakah ada/Berapa limit penyimpanan dari ScriptDB ini.
  • Masih suka kepentok masalah Limit Eksekusi Script, jadi kalo pengunjung blognya rame, butuh lebih dari satu ScriptDB.
  • Belum ketemu gimana caranya biar write access ke-ScriptDB hanya bisa dari satu subdomain saja.
Karena disini bukan forum copy-paste, jadi mending kita bahas ditelnya dulu okeh?
udah, okeh aja,, daripada gak dibagi :P

ScriptDb

ScriptDb is a JavaScript Object database for Google Apps Script.

Saving Data

function saveToDB(){
  var db=ScriptDb.getMyDb();
  var whatToSave={
    visitor:{
      id:"4",
      name:"Zuck",
      page_title:"AingCreations",
      page_uri:"http://aingcreations-reborn.blogspot.com/",
      action:"viewed",
      browser:"Firefox 10",
      time:"2013-05-20T17:11:45+0000"
    }
  };
  db.save(whatToSave);
}

Collecting Data

function collectDB(){
  var visitors=[];
  var count=0;
  var limiting=5;

  var db=ScriptDb.getMyDb();
  var whatToCollect={visitor:db.anyValue()};
  var searchOnDB=db.query(whatToCollect);
  while(searchOnDB.hasNext()){
    var fromDB=searchOnDB.next();
    visitors.push(fromDB.visitor);
    count++;
    if(count==limiting){break}
  }

  var Lol="\nFound: "+visitors.length+" Visitors\n"+JSON.stringify(visitors,null,"  ");
  Logger.log(Lol);
}

Modifying Data

function modifDB(){
  var db=ScriptDb.getMyDb();
  var whatToModify={visitor:{id:"4"}};
  var modifPart={
    partName:"time",
    partVal:"2013-06-10T00:00:00+0000"
  }
  var searchOnDB=db.query(whatToModify);
  while(searchOnDB.hasNext()){
    var whatToSave=searchOnDB.next();
    whatToSave.visitor[modifPart.partName]=modifPart.partVal;
    db.save(whatToSave);
  }
}

Deleting Data

function dellDB(){
  var db=ScriptDb.getMyDb();
  var whatToDell={visitor:{id:"4"}};
  var searchOnDB=db.query(whatToDell);
  while(searchOnDB.hasNext()){
    db.remove(searchOnDB.next());
  }
}

ContentService

When a script is published as a web app, the special callback functions doGet() and doPost() are invoked whenever a request is made to the script's URL. The ContentService can be used to return raw textual content. This allows you to write scripts that act as services, responding to GET and POST requests and serving data of various mime-types.

Codes at Google Script

Publishing as a Web App

Testing

Getting visitor facebook ID

The important thing about this Blog Notif is visitor facebook ID. We can get this ID by connecting our blog to facebook or better known as Facebook Connect.

I'm not writing yet about this, but you may still learn it from http://developers.facebook.com/ or you may analyze this blog source script if you want :)

By knowing our visitor facebook ID, then we can fetch more information about our visitor from facebook, such as their profile photo, locale language, gender etc.

Tester HTML File

To learn more about how the script flows, Download this BlogNotifTester.htm file, open/drag and drop into browser new tab, use browser console to monitor the script flow.

~ Have a good day :)

Sunday, June 2, 2013

Feed Cleaner ( this is how your posts or comments are deleted in our group :P )

Detect if User Posting More Then 1 Post in an Hour, Detect Post with Private Link or Attachment Not Available, Detect Comment Message Less Then 10 Characters, Detect Comment Message More Than 1000 Characters, Detect Comment Message with Repetition Characters More Then 10 Characters, Detect Comment Message with Repetition Words More Than 10 Words
App ID/API Key: Get Token
Wall ID:
Access Token:
Forbidden User IDs on Comment (split by comas):
Forbidden User IDs on Post (split by comas):
List of Forbidden Words in Regular Expression:
Load it Now