How to Make Text link to Hyperlinks in Facebook Comment? Comment plugin - html

Now this is very tricky thing. I have recently seen that many blogs do have facebook comment plugins where anyone can comment and place relevant links.
But the problem is those links are in text and are not hyperlink or you can say not clickable.
I found here in this article post right down you can see a facebook comment plugin, there you can see a text link is a hyperlink.
http://www.huffingtonpost.com/2014/11/25/black-friday-apple-deals-2014_n_6211754.html
Now my question how did that user do that? i mean from text to hyperlink. Becz normally it won't happen.
I have searched lot of stuff in google but i am not able to get the correct method.

The user doesn't make something that looks like a hyper-link display as a hyper-link, the webpage does!
What happens is that the scripting behind the page is using a reg is looking for a regular expression to pattern match URLs in the comments. When a match is found it'll be displayed as a hyper-link, if it doesn't match the regex it just displays as flat text instead of a hyper-link This either built into the Facebook comment plug-in or the website itself.
When text gets passed to HTML it has no way of telling what is and is not a link However if you process it through a script to identify links as being links you can tell it to display them as hyper-links rather than just plain text.
A great example/explanation of this is over at http://regexr.com/39i0i
Tl;Dr
Users don't make it happen, the plug-in/webpage make it happen.
With the exception of plug ins that require you use link tags, in the case of the page you linked though that is all that version of the Facebook plugin.

Related

HTML Editor that can be used for tags' sanity check

I am trying to use a text editor (without using an IDE e.g. eclise/IntelliJ) where I can analyse an HTML file e.g. which tags are unevenly used and also format HTML documents in a way that it picks up each tag and organises so that the document is more human-friendly.
I currently have notepad++ and Sumblime Text 2 on my machine. If there is any specific plugin that helps to do the job, could someone please advise?
** REASONING **
I have a messaging service that uses email templates and one of these has a bug somewhere. It's generating a misaligned (i.e. odd) tag which can be visible if I was to put it in some audit trail (gets picked up in a tabular view). I would like to use a text editor to check the buggy tag.
KR,
In notepad++ you can do that if your open and closing tags are below eachother for example
<div>
something here
</div>
but if you have it inline like this
<div>something here</div>
you cannot do much with it.
Is this what you are asking?
Also if you want the vertical tab lines to be visible click on the "show indent guide" in the top toolbar
There are several online tools that can format the HTML for you. Do a quick Google search for "online html formatter" and try a couple out. Some will provide more options than others. Once formatted properly, it'll be human readable and probably be pretty easy to spot the stray tag.

Facebook, StaticHTML and form summission

This is weird!
I have set up a form using RapidMailer, and on an external site it works fine. (Just to complicate matters, the form is within a <div> as I display a background image, and then use the <div> to position the signup box halfway down the page)
But ...
Put it within an Facebook (Thunderpenny) StaticHTML page, (which I think is <iframe>?) and whilst I can enter name/email, and the submit button shows mouse up/mouse down events, it just won't submit.
I tried adding "pointer-event:auto" to the div so that it was to the fore, but no go. And no good asking the app creator as I doubt I'll get a response. Anyone any ideas? (** I could include page code, but it's 90% links to external js files Rapidmailer sets up)
Is it 'cos I got a <div> within an <iframe>? Do I need to add an <object> to the code somewhere???
It turns out that for some reason, the HTML code cannot find / use the javascripts even with direct URL's. I strongly suspect it's to do with "cross browser" limitations. In otherwords, the StaticHTML <iframe> is on one server, and the HTML code is trying to access javascript on a second server. And as the RapidMailer script is using three scripts direct from jquery.com, it's difficult to know what can be eliminated as they all contain error trapping routines.
In the end, I had to add a direct link to a status update on the Facebook page, and redirect it to the signup form on my blog. I then pinned the post the top. Alas, now for some reason it won't display a graphic with the link, and instead insists on showing the URL itself! Oh well!

Getting website displayed correctly in Google

I have a website that is now listed in Google's search directory, but it will only display 'Home' as title and will not display a descriptive text as it would for other results found. This is the search I've done to retrieve my website: here. It's the 8th result (for me, might be different for you guys), but it's the only one that has no description attached to itself and no title (only Home).
I assume the title has got to do with the tags in my html, though if you have a look at the website's source code, the title is not Home. So I'm not quite sure what to do here. Also, I'm using wordpress for this website so maybe there's something I should be doing on the server-side to fix this?
I always assumed google would extract directly from the page, so I have no idea what to do here.
I'm guessing the page title used to be 'home' and Google just hasn't caught up with the change yet. Google doesn't check every time it returns your page as a result (think about how that would work).
You could also update the meta description tag in your homepage so Google can present a proper description of your site to searchers.

Jsoup - Trying to extract Comments number from web page

I'm trying to extract the overall comments number from a web page using Jsoup.
For example, here is a page (CNN): http://edition.cnn.com/2011/POLITICS/07/31/debt.talks/index.html?hpt=T1
I see that the class ID is cnn_strycmtsndff, but can't get to find the right command to extract it.
Can someone help?
Thanks
Unfortunately, I don't think Jsoup is going to cut it. If you use the Chrome developer tools you can clearly pick out the HTML used for presenting the "(##### Comments)" section, but if you just view the source, none of that information is there. It seems like they are using some Javascript to dynamically embed the information in the page.
This is what you see in "View Source":
<div id="disqus_thread"></div><script type="text/javascript" src="http://cnn.disqus.com/embed.js"></script>
So Jsoup will never be able to see the elements with the comment information.

How do I override the title of a bookmark for a web page?

When adding a bookmark or favorite the browser uses the TITLE tag of the page to automatically populate the title of the bookmark. However, my web pages use SEO-friendly titles which are not really user-friendly. Is there a method to override the title when the browser makes a bookmark?
I am aware that I can create a link on the page that calls javascript:
javascript:window.external.addFavorite("url","custom title");
But is is possible to do something similar when a user uses the menu or hotkey to create a bookmark?
You're trying to solve the wrong problem.
However, my web pages use SEO-friendly titles which are not really user-friendly
This is what you need to fix. Your page titles should be user friendly.
To be honest, if you're doing it right SEO and User friendly titles should be synonymous... can you post some examples as to why you feel the need for them to be so different?
I can't see how that would be possible. The browser takes the Title loaded, which is the Title displayed on the top of the page. When saving a bookmark, it doesnt go through the code. It just adds the URL and takes the site Title.
You could check if the "bookmark"-pressing triggers a javascript event, though, i think it woudlnt be cross-browser :)