Google Apps Scripting: How see the version number of a Google Sites page on the page itself - version-control

I want to see the version number of a Google Sites page on the page itself. I am talking about the numbers you see when you click the "More" button, then select "Revision History".
I am OK with any method to solve the problem, however currently I am trying to solve the problem with Google Apps Scripting.
I am able to see the last update time of the page by embedding the script below to the page:
function doGet(e){
var app= UiApp.createApplication();
var page = SitesApp.getActivePage();
app.add(app.createHTML('Last updated: ' + page.getLastUpdated().toISOString()));
return app;
}
The problem is, I could not find a getVersion() like method.
Thx.

You can't do this for several reasons.
The page version is hosted in this variable inside the google site pages.
webspace.page.revision
This is a good news but you can't access it.
1) If you try to access it using html box, the content of your html will be sanitized by caja and you will not access this variable.
2) If you try to build a javascript code and put it in an Apps Script caja will also forbid you to use variables from the parent frame. Even if you use SandboxMode.NATIVE.
3) If you try to put this code in some other site and include it as an iframe the content will be striped by your browser because of cross domain restrictions.
Sorry to say but what you want is impossible with todays caja restrictions.

Related

Events triggering loading content on Facebook's timeline

I am working on Apache Nutch modification project. We already swapped Nutch's original module with ours built using HtmlUnit. I need to download whole Facebook user site (ex. http://www.facebook.com/profile.php?id=100002517096832), which is going to be parsed using our own parser. Unfortunately Facebook is using mechanism called BigPipe (http://www.facebook.com/note.php?note_id=389414033919). That's why most of current website is hidden in <.!-- --> tags.
Usually when we scroll down Facebook page, new content is being unpacked every time we are about to hit bottom of the page. I have tried to use Javascript that scroll my htmlPage (HtmlPage object from HtmlUnit project), but finally I realized that scrolling is not triggering loading new content on Facebook user site.
How can I check, what event on page triggers loading content on current Facebook page? Maybe I should approach problem from different side, for example try to extract BigPipe "things" on my own? Have you ever did that?
Before dealing to your question … what kind of project are you trying to build there?
Since Apache Nutch is an open source web-search software, I think you are trying to build some kind of search engine, that scrapes Facebook user profiles/feeds to get data and make it searchable on some third-party website?
Well, that would be a violoation of Facebook Platform Policies:
I. Features and Functionality
12. You must not include data obtained from us in any search engine or directory without our written permission.
So, do you have that written permission?

Facebook Tab on pages

Whats the best way to develop a tab on facebook in a facebook page with content inside it? Would it just be html within that tab?
Easiest way is to install a 3rd party iframe App on your Facebook Page. You can find these Apps by searching for "iframe" in Facebook's search. Once you have one of these Apps installed, you can customize the HTML/CSS/JS of the iframe, which will then be reflected on you Page Tab. Alternatively, you could create your own Facebook App and install it as an iframe in your Facebook Page. This will achieve the same thing, and may give you more control, but you will have to host the html/css/js files yourself and it will be more work.
I recently have the same need.
To just place a facebook tab containing just a static html with text and image.
Here are the steps. It can be quite a nightmare to review the documentation of Facebook since it is always in change.
In the home page, click in the settings button. There is a link "Create application". You have to be sure to be in the Facebook development section
In the Create Application home page. In the upper menu there is the button "Applications". Here will be listed all your applications. If this is the first time, again the button "Create a new app"
3.Enter the information requested. Name of the application, an identifier (I prefer the same display name without spaces) and choose a category.
As a security step, a captcha is shown. Just fill with the characters in the screen.
Since your tab is an html. You have to host this file in your own server in order to have a path. The first tricky thing here is to convert this file into a php, asp, or similar extension. since Facebook uses GET or POST protocol to send information. You have to ensure that your file understands this requests. So, your server must accept the corresponding programming language. Even if your tab doesn't have any real code.
The configuration of your app is shown in screen. In the left menu, the option "configuration" displays the options to activate your tab.
click "Add plattform" button and select Facebook tab
fill the information required with the corresponding URLs. Note: Facebook always requires secured URLs so make sure that your server or hosting service has the SSL certificate validated.
Upload the image of your tab to be shown in the home of your profile in your tab section.
ok, so far we are good. Now. This was a long search. There is no longer the "Add to my webpage" link anywhere. So use this link to access to that hidden link. here Basically you enter the facebook app id and the URL of the hosted file.
Then you select the facebook page where you want to link this tab. And that's it!
note: the alternative to the link is this: (https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL )
Hope this helps. It was a waste of time when I have to search for the details so I want to share this.

How to put a like box/button on a Dreamweaver MX v6.0 designed site?

Basically i'd like to put a like button on the website so that fans of the site can like the websites Facebook page.
The Like button page doesn't give me the code when i click the button, just says "Only verified developers can be added as listed developers of this application. Read www.facebook.com/help/?faq=17580 for details." Is this a common error, or?
EDIT: Using Like box now, but would prefer Like button.
And the like box page gives me the iframe and XFBML codes. Sorry for being a n00b, but how do i add either one onto my site? I've tried Insert > Script and pasted it in there, using all four script types (Javascript, JS 1.1, JS 1.2 and VBScript but they don't show in the preview. Placed the code under the 'back to top' button at the bottom of the page. Not showing up when i look at code view of the online version though?
Hopefully its something really easy and obvious, but any help would be great.
Again, site is designed/updated with Dreamweaver MX 6.0.
I dont have that much experience with Dreamweaver - but implementing the facebook social plugins (eg. Like button) is very simple. All you have to do is copy and paste the XFMBL you generate from this link. Once you paste your URL into the "URL to Like" field and click "get code" you should get the correct code to use...
You place this code wherever you want it to appear - if you want the like button to be in the footer just paste it there...
The code snippet actually loads the facebook javascript sdk and places your like button inside an iframe on your page...
You can not place the like button code inside a different element - if that were possible people could trick you into liking their page by writing some different label on the button - eg. "Back to top" :)
This should be relatively simple to implement. If you are still having dificulties - why not try opening a new HTML file containing only the required HTML tags and the like button code...
Hope this helps!
Good luck!
The error appears because, just like it says in the message, you are not a verified developer.
In order to be a verified Facebook developer, you need a verified Facebook account, with a credit card or a phone number verification.
I'd suggest you verify your account as soon as you can if you plan to use more of Facebook's plugins and apps, since it will give you full access to their developer tools

problem getting my domain redirect to update .html files in dropbox after used iweb SEO TOOL

So I created a nice 6 page website hutchspropertyandtree.co.nr using freedomain.co.nr via dropbox public folder. Everything was working and updating properly until i updated with iwebs SEO TOOL. I added meta and title tags as well as description etc... PROBLEM is that even though my .html files in dropbox are correct and show all new code and tags. when i open up my domain hutchspropertyandtree.co.nr it doesnt show any of my recent seo tool updates.
im thinking that the cheap domainname from .co.nr is the problem? Is it possible that the default tags and titles and keywords entered into the co.nr website creation boxs are overwriting the newer ones in the html within my dropbox?
But still doesnt explain why a stat counter code and google analytics code in the footer and header respectively still do not show up when i view source in browser.
PLEASE PLEASE HELP.
It's because the page at hutchspropertyandtree.co.nr uses a frame to show the content from another location. The meta information comes from the page with the frame, not the page in the frame. You should be able to see the content of the frame using an inspector (comes with all browsers these days) or "View frame source", if your browser does that.
Note that any search engine hits to your pages will link to the dropbox URL, not the frame page (that has essentially no content from the viewpoint of a search engine). If you want search engine results to show up under that domain, you'll have to get hosting that lets you point a domain directly to it.

How can I pull in my BlogSpot page into a page on my web site

I have a blog on BlogSpot.com, and I have a domain based on my own name. I want to have a URL on my site (like http://www.mydomain.com/blog) that will then pull in the content from my blog page, but I want the URL in the address bar to stay on http://www.mydomain.com/blog, so that it does not look like you left my site.
(I have a Windows hosting account on 1and1.com)
I did Google this question, and I found how a few things, like:
1: Adding a tag in to "refresh". Tried this, but it changes the address bar.
<meta http-equiv="refresh" content="0; URL=http://myblog.blogspot.com" />
2: I also learned about the html iframe thing, but it has height and scrollbar issues.
3: Then, I found this partial code snippet, but I don't know what to do with it, or if it will even work against the BlogSpot server, or on my server:
<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://myblog.blogspot.com", false
objHTTP.Send
Response.Write objHTTP.ResponseText
%>
I am a client app guy, so this web stuff is all new to me.
Any help will be greatly appreciated.
The third option will probably work for the initial page load, but any links on the page will then direct the user to the BlogSpot page, and change the url. It simply fetches the page from blogspot, and then sends it to the user without any changes.
For me, the changing url is not a big deal, as long as it's easy for the user to get from one to the other easily; have prominent links on either page that tell the user where they go. Most people don't care about the url, they just care about the content.
Using an IFrame is probably your best bet. Many Facebook applications are in IFrames and still integrate very well.
I think using a regular frame or an iFrame is probably the easiest solution. What kind of scrollbar issues did you encounter? You can set custom values for some of these attributes, just check out the documentation here:
http://www.w3schools.com/TAGS/tag_iframe.asp
If you didn't want to use frames, you could actually proxy the entire page using a server side application like Squid. However, this is more difficult to setup, requires the ability to install software and configure firewall/iptable settings on your host, and must be configured properly to prevent malicious abuse.
-Mark
Here are some options you can try:
If you have PHP installed:
<?php
echo file_get_contents('http://myblog.blogspot.com'); // or you can use fopen()
?>
Or Server-Side-Includes installed:
<!--# include virtual="http://myblog.blogspot.com" -->
You can also pull blog content from Blogspot using the Blogger Data API.
The advantage of this is that you can reformat and reorganize the content to match the style of your website. The disadvantage is that it's more work than an iframe, and you probably won't match the full functionality of Blogspot.
I'm playing with this now to see whether I can use Blogspot as a type of CMS for a club news system.