Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Facebook page title renamed */
- var content = null;
- setTimeout(function(){ content = prepair(); }, 4000);
- setTimeout(function() { setTitle(); }, 5000);
- var username = ""; var title = "";
- function prepair() {
- var div_content = $('.userContent')[0];
- var profile = $('#fb-timeline-cover-name')[0];
- if(typeof(div_content) != "undefined" && div_content !== null) {
- content = div_content.innerText;
- }
- if(typeof(profile) != "undefined" && profile !== null) {
- username = profile.innerText;
- }
- if (!content) {
- div_content = $('#u_0_12 ._7grk')[0];
- if(typeof(div_content) != "undefined" && div_content !== null) {
- content = div_content.innerText;
- }
- }
- if (!content) {
- div_content = $('._1rg-')[0];
- if(typeof(div_content) != "undefined" && div_content !== null) {
- content = div_content.innerText;
- }
- }
- if (!content) {
- div_content = $('._44bj')[0];
- if(typeof(div_content) != "undefined" && div_content !== null) {
- content = div_content.innerText;
- }
- }
- if (!username) {
- profile = $('._371z')[0];
- if(typeof(profile) != "undefined" && profile !== null) {
- username = profile.innerText;
- }
- }
- if (!username) {
- profile = $('.profileLink')[0];
- if(typeof(profile) != "undefined" && profile !== null) {
- username = profile.innerText;
- }
- }
- if (content && content.length > 48) {
- title = content.substring(0, 48) + '...';
- } else {
- title = content;
- }
- console.log('Title = ' + title);
- console.log('Name = ' + username);
- return content;
- }
- function setTitle() {
- if (title) {
- $('#pageTitle').html(title + ' - ' + username);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement