confluence create a link of a page to another page name? - emacs

I am using Confluence via Emacs confluence-mode, and I would like to give my pages a meaningful name, but then also give them a short name that would make it faster to type when editing. Can I create a page that is just a link to another page with a different name?
For example, create a page called My meaningful name for this page and then create a link to that page called p1 that is simply a pointer to the other page. When opening p1, it would actually be opening the other page.
Essentially, I want to be able to open the page:
http://my-confluence.mydomain.com/display/MySpace/p1
And end up with:
http://my-confluence.mydomain.com/display/MySpace/My+meaningful+name+for+this+page
Any ideas?

Sounds like you need a redirect. On your p1 page, throw this inside an html macro:
<script type="text/javascript">
window.location.href("http://My meaningful name for this page.com");
</script>
That will automatically redirect to the correct page. Only downside is it might visibly show the p1 page for a fraction of a second. If it does, and that is unacceptable, I would refer you to this answer on Atlassian's forums:
https://answers.atlassian.com/questions/124121/how-to-properly-redirect-pages-in-confluence
It lists 2 plug-ins, one of which I use, which do it very seamlessly. They're not free though.

Can you describe your use-case a bit more? You can achieve this by using anchors (https://confluence.atlassian.com/display/DOC/Working+with+Anchors) if you're linking to the same page. If you need to link to a new page, this might help:
https://confluence.atlassian.com/display/DOC/Configuring+Shortcut+Links

Related

How to make a website that redirects to a random link on a list?

I'm wanting to know how to make a redirect a simple way.
I know nothing about code (Sorry for my ignorance) but I want to learn.
So I want to make a website that only redirects, so when someone opens it will get redirected to another website.
The tricky thing here is that I want the website to select a random link in a list I will provide, so I thought I could do it on a free website creator (wix.com) and I wanted to know if someone could help me do the code for me.
Thank you a lot.
You will need Javascript and HTML for do this.
HTML just do static things, so you will need create a list with Javascript and then modify the link on html page.
Just add this to the Head on your HTML file:
<script>
window.location.replace('http://www.reddit.com')
</script>
That will redirect to Reddit as soon as you open your html file.
I recommend that you use the "IF / Else" or "for" function to redirect to different websites each time you open your web page, because you said that you are learning, so go slow. Just study Javascript or Dart and you can do whatever you want on your site.

Preserve Google +1, Facebook Like, and Twitter Tweet This button counts after URI change

My question is very simple: is there any way to (programmatically, technically, or manually) make a Google +1, Facebook Like, or Twitter Tweet This button preserve its count after a change of URI?
Programmatically: Doing something with the javascript to make it show the combined counts of two URIs while posting the new action to only the latter.
Technically: Do they detect and follow a 301 redirect from the original resource? Is there any special text I can include in the HTTP header to tell them that they should move all "points" from the old URI to the new one?
Manually: Some form somewhere on their site that I can submit or someone I can email that will be able to copy our points over to the new URI?
(note that I use URI and not URL in this question on purpose. The canonical resource link is changing from something.php?id=idnumber to /mycoolproduct/)
EDIT
Bounty started, but don't answer with "it can't be done"
I believe there is only one solution that fits your request above universally. That solution would be to 301/302 the old URIs to the new URIs and then keep using the old URIs with your social buttons. All the major social buttons allow you to specify the URL for which to like/g+/tweet/etc. This would preserve your existing social share counts and all shared posts would still direct to the same page. The choice now becomes whether to 301 or 302 redirect. A 302 may help preserve current search placement and avoid loosing your ranking if its pretty good. A 301 redirect (moved permanently) will cause search engines to start indexing your new URLs and dropping the old ones. This might cause a loss in current search rankings. It appears that as of this post, nobody is honoring redirects for social votes of any kind.
So I think the the safest route is to 302 redirect and continue to use the old URIs for social votes. You will keep your equity this way, but must maintain your redirects and become even more invested in the old URI template. How are your redirects implemented? .htaccess? or in page? You will need to weigh the cost-benefits for your case.
Otherwise you should probably 301 and start using the new URIs for your social buttons. In this case you might loose your social equity, but are free to build new without fear of messing up anything. If the social equity you are replacing can be recouped in say 6 months or less I wouldn't bother with it and start fresh.
However, this brings up an interesting point. You mentioned programatically adding two counts. Well yes, you could put together some JavaScript to add a couple counts together, but I gotta ask why? Adding them together for visual display purposes will not actually help increase referral traffic or search ranking. So its just a facade that I don't think helps you. If you're just looking to fool your visitors into thinking you're popular, why not just generate an image server side that keeps counting up. (bad joke, don't do it!) Bottom line you can't actually redirect your social equity, you may be able to pretend to have moved it, but you can't actually.
Considering your original question asks about several social buttons, its important to note that even if one or two of these services started honoring redirects when applying social votes, it wouldn't relieve you from making the decisions above. You'll still need the redirects for existing backlinks, and if you are supporting multiple social buttons on your page the choice of redirect type will need to be made with all of the social buttons in mind.
I can't speak for how to do this with Twitter/G+ but for Facebook:
You can't 'move' the likes and comments between URLs, and for new content you should definitely start using the new URLs, but for your existing URLs you can still have the original like counts/comments work if you:
Continue pointing the Like button on the new URL to the old URL (i.e <fb:like url="http://oldurl"/>
Add an exception to your redirect code so that when Facebook's crawler (facebookexternalhit/1.* - currently 1.1) accesses it, the original set of open graph meta tags are displayed (this will keep the description, title, thumbnail, etc, working as before)
Other users that land on the 'old' URL will still be redirected to the content in its new location
I have a real solution to this problem it might not be the most conventional but it does work 100%. Using a simple jQuery plugin called sharrre. Keep in mind I'm not the best jQuery coder (If you see improvements please let me know!) but this works regardless.
Here is how I did it on my site:
Using the sharrre plugin you can add the current share count to any element on your page. I simply got the data for both URLs then added them together and displayed them on the like, tweet, share, etc buttons.
This example is with Twitter but I'm doing this with Facebook, Google Plus, Pinterest and Linkedin. Here is the code:
<li id="twitter" data-url="CURRENT-URL" class="twitter sharrre"></li>
<li id="twitter-old" data-url="OLD-URL" class="twitter sharrre" style="display: none;"></li>
Then I called sharrre's code:
$(function(){ sharrreItUp(); }
This is how my function looks on my .js file:
function sharrreItUp() {
$('#twitter').sharrre({
share: {
twitter: true
},
enableHover: false,
click: function(api, options){
api.simulateClick();
api.openPopup('twitter');
}
});
$('#twitter-old').sharrre({
share: {
twitter: true
}
});
setTimeout(function(){
var oldTwts = $('#twitter-old .box .count').html();
var newTwts = $('#twitter .box .count').html();
$('#twitter .box .count').html(parseInt(oldTwts) + parseInt(newTwts));
}, 2000);
}
And BAM... you have your new URL being sharrred and the old shares from different social networks get added into them.
Unfortunately, there is no solution for this. We have tried all possible solutions and you will simply lose your social equity if you do a 301 Redirect. We found it to not be worth the hassle of trying to maintain our vote counts, and have instead pointed our buttons to the homepage in the interim of moving to the new url structure.
demo: http://so.devilmaycode.it/preserve-google-1-facebook-like-and-twitter-tweet-this-button-counts-after-ur/
i don't wanna say something wrong, but i think you just need to define the URI inside each share button, so no matter from what URL the vote come from, the defined url will be used as count.
if you, instead already have two different sources and you want to join it, you should follow the iframe src and scrape the count from it; for google +1 the div id that contain the count is #aggregateCount for twitter is #count; an example could be as below:
<?php
$doc = new DOMDocument();
$doc->loadHTMLFile('iframe-url-goes-here');
$count = $doc->getElementById('aggregateCount');
echo $count->nodeValue;
?>
then, on your page after the DOM is loaded and the widget are loaded, you can append your own value.
hope this help, in anycase i prefer the first way.
Put in the head of the new page
<meta property="og:url" content="old_url_here"/>
This way Facebook attributes likes for the old page. The only downside is that this way when people share your link, the old rich snippet will be included.

Facebook App Setup

I created FB application that use iframes, and it's working okay, as it should, BUT I need to check from what page is calling it.
I want different pages to pass different variables to that iframe location.
I already know how to set up it to three levels ( original page, application page, and on tab page, with different display content ), but I need to check from what page it's called.
I am thinking that it can be done in 2 ways:
1 way: Find way to pass specific variable based on page that is using this application as tab, and then redirect it to right location
2 way: Find way to create new application outside facebook ( maybe API or something ) and then enter all those values including: App name, app link that have this variable included, app tab link, using iframe and not FBML...
I will love to use 2. way...
I'm not asking you to show me code, I know that I need to do my job, I'm not asking you to do it for me, I'm just asking for help, for directions from someone who already create something like this, to point me to right direction where can I find way...
Also, please don't tell me to read bunch of stuffs, like FB Documentation or whole book that have all other "not-used-here" stuffs, I need specific part where there is a word about this...
If someone know anything about this, write it here...
Thank you!
The "page" parameter is passed along within the "new" signed_request parameter on (iframe) tabs. You get what you need for "free" ;)
page: A JSON object containing the page
id string, the liked boolean if the
user has liked the page, the admin
boolean if the user is an admin. Only
available if your app is an iframe
loaded in a Page tab.
http://developers.facebook.com/docs/authentication/signed_request/

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.

How can I create a website summary with Perl?

When you share something on Facebook or Digg, it generates some summary of the page. How would I do this in Perl? What algorithms are there?
For example:
If I go to Facebook and tried to share this question as a link:
How can I create a website summary with Perl?
It retrieves "Facebook/Digg get website summary? - Stack Overflow" as the title (which is just the title of the page) and [... incomplete question?]
CPAN is your friend.
Some promising looking modules:
HTML::Summary
HTML::SummaryBasic
Lingua::EN::Summarize
Assuming you mean sharing a link...
Usually the summary is written by the user submitting the URL. If you have to write a summary automagically this can be achieved by:
Using the first 100 or so characters of the document body (in itself not easy)
Using metadata like the description or keywords (often empty or spammed)
Context-relevant summaries like recreating Google snippets (sorry its PHP but simple)
Tags/keywords from the document using something like the Yahoo Keyword Extractor API or your own keyword density function
Your best bet is to ask the user!
Hope that helps somewhat :)
Basically you want to scrape the URL and find the "most significant paragraph" which might be the first <div> or <p> element after the first <h2> or <h1>, depending on the layout of the page.
You could check and see if there is a meta description on the page, but that leaves you at the mercy of whoever wrote the meta description.