I have a bookmark in my Firefox like this:
http://foo.bar/index.html?year=2017&month=7&day=21&group=11,21,31&type=something
My question is whether it's possible to dynamically assign year, month and day in such bookmarked URL?
I don't want to change year, month and day every time it has changed. Is there a way to replace it with something like
http://foo.bar/index.html?year=getcurrentyear()&month=getcurrentmonth()
Or something like that?
You can set a single parameter in the bookmarked url manually from the address bar. You have to bookmark your url, set short name for it and replace the part of the url you would like to set dynamically with %s, i.e. https://translate.yandex.ru/?lang=en-ru&text=%s. After that you may type url-short-name some-text in the address bar and open the translation page for some-text.
A more complex solution is to create a bookmarklet like this
javascript:(function(){d=new Date();location.href="https://foo.bar/?year="+d.getFullYear()+"&month="+d.getMonth()})();
To add this to your bookmarks, you need to bookmark any page and than replace its address with javascript code. I suppose if you are good at Javascript you may come with more elegant code for your bookmark.
You can find more about bookmarklets in this question.
Related
I'm working for a tennisclubb and need to create a button on our page that sends the user to our booking system. The thing is that the URL ends with query string parameters, http://../../boka_reserve_reg_client_app.php?sess_adm_club_id=25&YEAR=2016&MONTH=04&DAY=26.
If I crop the URL right before the first "&" you will still be able to access the booking page but it will not have any function.
So what I need is a form that submits the parameters to the end of the URL where the user types the year, month and day or a pice of code that generates a new link every day with the correct date.
Is this possible to fix without using PHP? JavaScript is absolutely fine.
Thanks!
We're generating some emails programmatically. We need to include a hyperlink that takes people to a page on website A, but we want to use website B to track their click before redirecting.
Is it safe to show the URL to website A, but in a hyperlink that really takes them to website B? That is, something like this:
Here's the page you wanted:
<a href="http://website-b.com/someTrackingToken">
website-a.com/theThingYouWereExpecting
</a>
... or does this look sufficiently scam-like that some email clients might object to it?
Note:
We specifically do want the website-a.com URL to be visible to the email recipient.
The sites are on different domains.
You can set the visible link and the href property to be two totally different things and there's usually little to no consequences, this is pretty standard for most mailers that need tracking.
The thing is, why not just wrap some text instead of a literal link? Present it as a button if you're worried about "click ability".
If you want to present a link that's nearly the same, why not just append some parameters on the end that trigger the tracking action? Like /x vs /x?token=XXX where you can grab that and and process it at any point of handling the request. Just suppress the display of that in the raw URL you're showing.
I'm trying to add a unique ID to page titles in confluence.
I managed to add a user macro which uses jQuery to add the page ID & a string prefix to the title;
## #param _prefix:title=Prefix|type=string|required=true|desc=Prefix for the page ID
<script type="text/javascript">
jQuery("document").ready(function() {
if ("${param_prefix}" != "${_prefix}")
jQuery('#title-text a').prepend('${param_prefix}', '$content.getIdAsString()', ' ');
});
</script>
But I want this to actually edit the title, not just get added at runtime. It needs to be consistent throughout, allowing that ID to be a search term & appear in all menus etc.
I can't find anything which suggests this is even possible but it must be, surely!?
$content.setTitle("newtitle") should work. BUT! you will have to make sure that this only happens once, otherwise your title will get repeatedly prepended with your text every time this macro is rendered. I guess you might check if the title starts with your prefix already. And then you might want to add handling of changing the prefix.
See http://confluence.atlassian.com/display/CONF35/Guide+to+User+Macro+Templates#GuidetoUserMacroTemplates-OtherObjectsAvailabletoyourMacro for more details.
That being said, this seems like a pretty kludgey way of solving whatever problem you have. I would suggest reconsidering if this is really what you want to do.
You can use the actual Confluence page ID or the page tiny link rather than generating an ID of your own. Both of these are static.
On any Confluence page, type "k" to see a hyperlink. You might be surprised to see it also contains a tiny link. Atlassian confirms that the tiny link stays the same, even if you move and rename the page (https://jira.atlassian.com/browse/CONF-27049). This is a consistent way to reference the same page with a fixed URL. Another way is to use the Confluence built in PageID.
Confluence Knowledge Base: How to get Confluence page ID
https://confluence.atlassian.com/confkb/how-to-get-confluence-page-id-648380445.html
Ensure that the current user has permissions to View and Edit the
page Navigate to a specific page
Go to Edit Mode by clicking Edit button or press 'e' key
The URL in the address bar will change once you enter Edit Mode
Page ID will be displayed as the parameter in the URL e.g.: When entering Edit Mode, the URL will change to http://my.domain.com/pages/editpage.action?pageId=1540132
In the example above, 1540132 is the Page ID.
To get the page ID with a macro:
ContentEntityObject contentEntityObject = conversionContext.getEntity();
System.out.println("pageId : " + contentEntityObject.getId());
To change a title: content.setTitle("newtitle").
Remember, check if title contains the page id before setting title = title + page ID.
I'm looking to build a wordpress site with multiple authors that will each be posting content that viewers can then "like".
What I am trying to figure out is if it would be possible to somehow keep a track on the number of likes each author is getting in total.
Would the best way to do this be too just have multiple Apps with different ID's and somehow generate the like code dynamically based on the Author or is there a smarter way to do it ?
Once I have this in place how hard would it be to pull the counts into an HTML widget to display a kind of league table of most liked authors ?
I think you can try to achieve this with the JavaScript SDK and the Like callback.
http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
But you will have to record those likes into your database and pull count from there.
Use the ref parameter of the like plugin if you don't have easy access to do what Alexander recommended (If you can store the data yourself it's better as you can really make your own data analysis). But here's the out-of-the-box way Facebook provides for tracking where a like came from.
From: http://developers.facebook.com/docs/reference/plugins/like/
ref - a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some
punctuation (currently +/=-.:_). The ref attribute causes two
parameters to be added to the referrer URL when a user clicks a link
from a stream story about a Like action:
fb_ref - the ref parameter
fb_source - the stream type ('home', 'profile', 'search', 'ticker', 'tickerdialog' or 'other') in which the click occurred and
the story type ('oneline' or 'multiline'), concatenated with an
underscore.
my question is analogous to the "mailto:email#email.com" type of link but is more specifically:
if a phone number exists on a page and is viewed by a user on an iphone (phone number will appear as link), is there a way for that link to automatically (upon user clicking) ask the user if they want to add that number to the contact, and then auto fill certain details?
this seems a bit too amorphous to be obviously possible, but you never know.
Nope. Phone numbers will be recognized by Mobile Safari automatically, and be "forced" to be seen as telephone numbers by doing something like this:
555-1212
But you can't control the phone's behavior when the user taps the link. (Cool feature idea though. :) )
It think it's not necessary to use a tel: as a href protocol prefix. I am not sure if something like this validates or is somehow standard. There is also a skype href hack: href="skype:asdasdasd".
Alternative Solution
iOs also detects telephone numbers in text automagically. They just need the right format. See also here for formats: http://hjacob.com/blog/2009/07/making-a-phone-number-clickable-for-iphone-users/