can not Hyperlink a URL - javascript

I Have a url Which i want to hyperlink on my website but that url is not working after giving hyperlink or copy-pasting in the web address bar or refreshing the page, that url is only working from the original website. . . . If Open the link from original website its opening but Source code is invisible . . . .please help me
URL is
http://jntuconnect.net/results/results/zMO9-z4RtsGFvQq5BcFyav1G9WYwHAkyfMoH49pbaATJCr3zhnoPJnBVYvTw_4fBxyMLLmVLHauTIwzoqJSTHA,,
Please help me in hyper linking it

You are trying to link to a results page that is dynamically generated and behind a CAPCHA.
My guess would be that the long string of hash at the end of the URL is an encoded string that contains a time stamp or some other expiring method. Also since the page you want is behind a CAPCHA check that long hash at the end of the URL probably also encodes some sort of "success" message that says you filled out the CAPCHA. It wont be possible to link directly to the "results" page because it doesn't exist until some query parameters generate it.
A better option would be to see if they "iBongo" offers an API you can query. iBongo seems to be the company that is powering http://jntuconnect.net.

Related

Change url based on the clicked link (Javascript html)

I'm having a problem, or better to say a doubt about how to do.
Let's explain: I have an website similar to a blog where I write articles and they are displayed in the homepage. I want that every time I click on an article it redirects me to the page where the article's content is shown. I save every article in a database with the title, date, content, etc... My doubt is: should I create a .html file for each article or only a file called "article.php" and when I open it, it changes the content getting the data from the database?
Second question: I want that the url of the page changes based of article that I click. For example I click on the article called "Today and Tomorrow", I want that the URL appears as "mysite/today-and-tomorrow/", not "mysite/article.php".
I'm a bit confused about this topic so if anyone can help me i'd be very happy.
Thanks in advice.
I have tried
var link = 'www.example.com/training/product.html';
link.split('.html')[0];
window.history.replaceState( null, null, link );
But it changes the URL dinamically, so for a few seconds it appears the original URL, in my case it appears "mysite/article.php" and then it changes in "mysite/today-and-tomorrow". I don't think it's properly correct.
I also tried
function openArticle(title){
var rightTitle = $(title).text();
rightTitle = rightTitle.toLowerCase();
rightTitle = rightTitle.substring(rightTitle .indexOf(':')+2);
rightTitle = rightTitle.replace(/[^A-Z0-9]+/ig, "-");
event.preventDefault();
window.location.href = title.href + "/" + rightTitle;
}
But when I click on the element the "article.php" remains in the url
should I create a .html file for each article or only a file called "article.php" and when I open it, it changes the content getting the data from the database?
No you dont have to. You can pass article id as a "query string" to "article.php" and it will take care of providing proper article to the end user.
I want that the url of the page changes based of article that I click. For example I click on the article called "Today and Tomorrow", I want that the URL appears as "mysite/today-and-tomorrow/", not "mysite/article.php".
You are talking about a feature called "URL Rewriting" which produces nice & meaningful URLs. In order to implement it you need to:
Design your database in a way which it can map articles id to its title.(for creating alias)
You have to enable URL Rewrite in your web server. (for example if you are using Apache as web server, you need to enable mod_rewrite).
You have to embed your rules for mapping & routing nice URLs to the original ones in a file called .htaccess. as a sample How to write htaccess rewrite rule for seo friendly url
I was just trying to help you get an overall idea of what you are looking for from technical point of view & as you know Its impossible to cover your required information in just a single post.

HTTParty not returning LinkedIn page

I'm trying to grab someone's full name off their LinkedIn profile using HTTParty and Nokogiri. For some reason, HTTParty is not returning the actual LinkedIn HTML page. It's something completely different (see my terminal output). I tried this code with other URLs and it works fine. Any ideas?
Here's my code:
# Store the LinkedIn URL form command line.
linkedin_url = "https://www.linkedin.com/in/janedoe"
# Get the contents of the LinkedIn page.
page = HTTParty.get(linkedin_url)
p page.parsed_response
EDIT: Turns out, the HTML page I'm getting back just contains a script that creates a redirect -- any suggestions on how I can reach the final page?
That is the page. It is HTML, and it performs a redirect to another page. Go to the specified link in your browser, and see if it redirects. If it does, use the link your given URL redirects to. That will also be HTML. If you need help parsing your HTML, DON'T USE REGEX.

Acrobat Javascript: passing a UTM parameter from URL into a PDF button

I have a PDF that has a button with field name ctaButton.
ctaButton currently has a url pointing to https://mywebsite.com.
I want to host the PDF on my server at https://mywebsite.com/hosted.pdf.
And when I send someone a link to the PDF, I want to attach a UTM_term parameter ?utm_term=customer1 and then have the PDF read this parameter and update the ctaButton url to https://mywebsite.com/?utm_term=customer1.
I've been messing around with the Javascript actions in Acrobat for a couple of hours trying to make this happen. Any help greatly appreciated.
You can get the full url to the document using...
var myURL = this.url;
"this" in Acrobat JavaScript is the document context.
I did hours of research and came to this conclusion – Javascript in Acrobat is like trying to code in 1985 AND browsers will not execute whatever code you come up with.
So I used this workaround:
When I send the PDF to someone, I send it as a link with a base64
encoded stringified JSON package that contains a bunch of tracking
data but importantly, the name of the file to access as well as utm
parameters specific to the recipient
The link hits a server handler (NodeJS) that extracts the encoded
JSON package, and uses the data in the package to serve up an HTML
redirect page pointing to the right PDF file
Importantly, the HTML page also saves the JSON package to the
browser's localStorage . . . this comes in handy in subsequent
steps
The PDF file opens in browser (it doesn't have to, could be opened on
desktop) and the call to action link has a link to a get request
handler
The get request handler serves up ANOTHER redirect page
This second redirect page accesses the browser's local storage, looks
for the utm parameters I set for that user, and then redirects to the
sale page, with nice utm parameters attached
So to sum up, you don't add the utm parameters to the call to action link in the PDF (because that would make the world too easy to live in) and instead you do all these acrobatics (no pun intended) to attach utm parameters in the link clicks (via JSON strings saved in localStorage) during the process (i.e. when user opens email to extract file via link, and then when user clicks call to action in the PDF).
Any questions or clarifications please let me know in the comments and I will do my best to address.
Caveats
Only works if user uses same browser in all steps (i.e. if Susan opens the email in Safari, saves the PDF, then clicks the call to action in the PDF, and the link opens in Chrome, utm parameters will not be passed).
Assumes browser is modern and has localStorage
UPDATE: I came across another solution. It's a bit more convoluted. Diagram below.
Porky.io is a Javascript extension for Adobe Indesign. So flow is:
send Porky.io the customer data you need (e.g. utm's for links)
Porky.io generates PDF from a template you provide with the customer data you provided
Listen for a new file save from Porky
Do something with the file (e.g. email it to customer)
I believe you need to run an instance of Windows somewhere in the cloud (e.g. on Azure) to run Indesign with the Porky.io. Unless you want to rely on your laptop.
My project's not big enough yet to warrant setting this up . . . but good alternative if I need to make my current solution more robust.

Modify href -or- URL Redirect / Rewrite and pattern matching using javascript or jquery

Im struggling to figure out the best way to redirect/rewrite urls with some pattern matching using javascript.
BACKGROUND:
I have a blog filtered by tag: http://adrtimesv6.squarespace.com/library/?tag=The+Psychology+%26+Neuroscience+of+Mediation (select view as visitor if that comes up)
I have another area in the site called "Collections" where i load in groups of posts from the library in its own real page with other content in a more controlled environment with page titles and urls that are better for seo, like this: http://adrtimesv6.squarespace.com/collections/the-psychology-and-neuroscience-of-mediation. the posts are loaded in via a query that pulls in posts from the library that have a tag that matches the name of the collection page. this is working pretty well. the problem im running into is that when someone filters the blog posts by tag i want them to be redirected to the collection page rather than go to the blog filter page.
QUESTION:
What im trying to figure out is how to use jquery to redirect all the /library/?tag=[path] urls to /collection/[path] urls. To do this i think i need to use jquery to:
1) swap "/libary/?tag=" to "/collections/"
2) revise the rest of the path from the tag formatted path "The+Psychology+%26+Neuroscience+of+Mediation" to my collection formatted path: "the-psychology-and-neuroscience-of-mediation"
ADDITIONAL INFORMATION:
I am using a CMS so i dont have access to things like the .htaccess file. in the CMS admin settings there is a url redirect panel that allows me to list some basic redirects in this format: -> ... but trying this with the tag filter urls is not working.
Im mostly concerned with this redirect occuring when the user clicks on the tags listed at the bottom of the blog post - so i could use jquery to modify the href attribute in the tag listed for the blog post. just not sure how to write the pattern matching and rewrite the format correctly. ive tried a bunch of things but cant seem to get it.
or perhaps use window.location.replace somehow?
UPDATE:
In my particular case, i found that i could update my template code and json formatters so that the tag link href generated matches the url in the collection section - so my problem is solved ....however, i still wonder how i would do handle this for other situations.
basically, 1) how to use javascript or jquery to check if the url (either href on the page or the browser url) contains something, then replace that with something else, and then modify the full url so that it is a simple dashed url .... takes out all + signs and replaces them with - and removes the %26 for & characters to return a simple url string, etc, like: /here-is-the-path
On a single page, you can use this to forward a visitor to a new page:
window.location = "http://www.google.com"
You could add logic to use the same script on every page. For example:
if ( document.location == "http://adrtimesv6.squarespace.com/library/?tag=The+Psychology+%26+Neuroscience+of+Mediation" ) {
window.location = "http://adrtimesv6.squarespace.com/collections/the-psychology-and-neuroscience-of-mediation"
}
and so on. You could even add more advance string manipulation to handle every URL.
But doing a JavaScript redirect in this manner will not have positive SEO effects such as friendly URLs. It will not enable your web server to handle the new URL; if http://adrtimesv6.squarespace.com/collections/the-psychology-and-neuroscience-of-mediation returns an error from your web server, no amount of front end JavaScript will be able to fix that.
Doing this with JavaScript this would probably be a negative experience for your users, because they would first have to download the page from the first URL, then execute the JavaScript, and then download the page from the new URL.

Javascript, jquery, ajax url query string rewrite

I thought this would be easy but I guess I was wrong. I have a url;
http://www.example.com/aa/bb.html?uid=123
using javascript jquery and html, I am able to retrieve data from a json api with the uid in the sample url above. However, I don't want that url displayed like that in the address bar after the data has been parsed. Rather, I need it to display as;
http://www.example.com/aa/item-title
where item-titleis the title of the data referenced by uid=123.
A php mod-rewrite would have been ideal, but this project does not make use of server side scripting.
Thanks in advance
If you change or modify the URL then the browser try to fetch data fro the new URL. You can do something with the part of URL after # mark.
Like :
http://www.example.com/aa/bb.html?uid=123#old_part
to
http://www.example.com/aa/bb.html?uid=123#newpart
I can see only one solution to your problem as you don't want to use mod_rewrite. You can redirect from first page just changing the URL based on the given uid value to the next page you want to display.
First page - read parameter uid and build the redirect URL based on the title(not any other stuff in your first URL page)
Redirect to the built URL
In redirected page do the rest of page specific stuff.

Categories