html agility pack url scraping href - html-agility-pack

Hi I am using html agility pack from the nuget packages in order to scrape a web page to get all of the urls on the page. I use this code for get all links in a body site:
HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//a[#href]");
in a one site i have a problem, a href is in this mode:
<a data-v-b2e8c352="" href="#/">Home</a>
<a data-v-b2e8c352="" href="#/subscribe" class="">My subscription</a>

Related

jQuery carousel plugin, cycle2, not working in joomla 2.5 website

I'm trying to set up the jquery carousel plugin, cycle2, in joomla 2.5. I want a straightforward responsive carousel which will autostart and just run thru a series of pics on a loop on the introductory page in a joomla base website. I tried cycle2 out in a single page localhost website and it works well. But in joomla, it's not working. I've installed the 3 js files, jquery.cycle2.js, jquery.cycle2.tile.js and carousel.js in the template javascript folder and listed them in the template index.php folder, as I have done with a lot of other jquery code which running without any problems, so I'm puzzled as to why cycle2 doesn't work. Also, firebug shows that the cycle2 js files are not being loaded. I can't figure out why this is so. This is the html segment from the joomla page:
<div id="carousel">
<div class="cycle-slideshow responsive" data-cycle-timeout = "3500" data-cycle-speed = "1000 data-cycle-fx="tileBlind" data-cycle-tile-count=17>
<img src="/templates/beez_20/images/carousel/siti_rs_1.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_2.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_3.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_4.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_5.png" >
</div>
</div>
Any help would be welcome.

using ZURB Foundation with laravel

I am new to laravel so I am not sure how this can be achieved. I am using ZURB Foundation and trying to create a button in the page.
I use linkRoute always to redirect to a named route then redirect to a specific controller action. I have the below:
<body >
<h1 align="center">ShopCon.com</h1><br><br>
<a style="margin-left:50px;" href="{{ HTML::linkRoute('membersaccess', 'Members Access') }}" class="medium success button">Login or Register</a>
</body>
but when I render this, it shows like this
Members Access" class="medium success button">Login or Register
instead of showing the button and text within it and link to named route. How can this be fixed? I read something about macros but unable to clearly understand them or use them to achieve this.
Picture included for reference:
HTML::linkRoute produces an HTML anchor tag.
Since you only want the URL, use URL::route.

How can I create a variable Meta property og:image for multiple pages?

Here's the code i'm trying to get work which should explain what I'm trying to do.
<script>document.write('<meta property="og:image" content="' + location.pathname.replace(/\.html$/, '.jpg') + '">')</script>
Just trying to edit meta property create an image for the og:image that has the same name of the .html file. So far no luck
Facebook thumbnail images are generated through something like a search engine web-crawler. It follows links and fetches the needed data from the page. But clients like web crawlers and fb-share only see your HTML, not all the resources on a page - namely client-side scripts like javascript & jQuery. That means your script will not be run, and thus the meta tag not created. Instead try a PHP server side implementation like:
http://mylink.com/?ogimage_id=7 calls
<meta property="og:image" content= <?php $path_to_image_dir . "/" $_GET['ogimage_id']
See my answer here Facebook sharer.php, how to have multiple og:image tags?

How to add share buttons in magento CMS pages?

I have created CMS pages in Magento and I want to share with Social site using share buttons Facebook, Twitter, Google+ so any one to tell me how to do that ?
Add this part to :
your_package/your_theme/template/page/html/head.phtml
before this line --> <?php echo $this->helper('core/js')->getTranslatorScript() ?>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "ur-c297c92f-9661-1cf3-697d-47c19ab7e281"});</script>
Add this part to your cms page :
<span class='st_facebook_hcount' displayText='Facebook'></span>
<span class='st_twitter_hcount' displayText='Tweet'></span>
<span class='st_googleplus_hcount' displayText='Google +'></span>
NOTE: using sharethis extension
You can check below URL for Addthis button, select style of button you want to share, grab the code and add that code to Magento Admin >> CMS >> Pages. click on to Html view of Editor and paste the code which you have grab from Addthis site, and you will see share buttons on front end. Another method is you can add this code to your template file commonly used for Example 1column.phtml is used for CMS pages and you need Share buttons on all CMS pages then you can paste the same code in .phtml template file.
Add this : https://www.addthis.com/get/sharing#.UK8_PoafHcc
Although this is an old thread i would like to share my answer which i found.
Add a meta tag in
template/page/html/head.phtml
<meta property="og:site_name" content="yoursite.com"/>
Create a Custom Variable from System/Custom Variables by pasting the Facebook sharing button code to Variable HTML Value.
To add like/share button to cms or static block, use the “Insert Variable” button to insert the Custom Variable you have just created.

Using plugin outside of Wordpress pages

I am trying to use lightbox plus plugin for Wordpress which works fine for most of my site.
I have a php page which is used by a jQuery AJAX function to retrieve data in order to paginate a large result set back in wordpress. This page is not part of wordpress.
I have managed to get Wordpress functions to work fine in this php page by using:
define('WP_USE_THEMES', false);
require('/home/love/public_html/dev/wp-blog-header.php');
require('/home/love/public_html/dev/wp-load.php');
However, in this page is an include, and within the included file is a link to an external sheet which is meant to be brought in with a lighbox:
<a class="" rel="lightbox" href="<?php bloginfo('url'); ?>/more-product-info?a=<?php echo $post->ID ?>">
<div id="moreprodinfo">More Info</div>
</a>
This method of retrieving information in a lighbox works ok on most parts of my site, but its just not working on the part that uses AJAX to retrieve the link to the lighbox page.
I assumed it was something to do with plugins not working when the page is not part of Wordpress, but all the Wordpress function have been working so why not plugins? Also my cufon plugin doesnt work on this ajax retrieved page either.
Is it becuase I am using .html javascript function to display the content retrieved by AJAX:
if(pageType == 'prizeHome'){
loading_hide();
$("#tab-prize-home #container").html(msg);
Any help would be appreciated
It looks like a common issue when using ajax to load html content :
You probably call lightbox and cufon when document is ready, which happens only once before your ajax call. You have to call again lightbox and cufon after your ajax call.

Resources