Skip to content

Instantly share code, notes, and snippets.

Created April 6, 2015 07:35
Show Gist options
  • Save anonymous/a290075c2d6e8cd2c48a to your computer and use it in GitHub Desktop.
Save anonymous/a290075c2d6e8cd2c48a to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head> <table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td colspan="3"> <a href="http://clicks.skem1.com/trkr/?c=13068&amp;g=5316&amp;p=d1785ffe965dd27d596d9f1490f3bf40&amp;u=ab43c61c8b8c153cb11d1ccbcafb8811&amp;q=&amp;t=1" target="_blank">
<img src="https://dub119.mail.live.com/Handlers/ImageProxy.mvc?bicild=&amp;canary=f%2bi7zrJk07ssdltxI4H8ZvUPmVw6tb%2fuMLBpdyvKVAQ%3d0&amp;url=http%3a%2f%2fnewsletter.edropshipping.net%2f2014%2fcommon%2fnewbb%2fheader_en.jpg" style="display:block;" alt="" title="" border="0"></a></td>
</tr>
</tbody></table>
<table height="x" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td height="x">
<a href="http://clicks.skem1.com/trkr/?c=13068&amp;g=5316&amp;p=d1785ffe965dd27d596d9f1490f3bf40&amp;u=5a621ec10e8b5aba75d9f4604c00add0&amp;q=&amp;t=1" target="_blank"> <img src="https://dub119.mail.live.com/Handlers/ImageProxy.mvc?bicild=&amp;canary=f%2bi7zrJk07ssdltxI4H8ZvUPmVw6tb%2fuMLBpdyvKVAQ%3d0&amp;url=http%3a%2f%2fnewsletter.edropshipping.net%2f2015%2f4%2fs1%2fn1%2fcamping_en.jpg" style="display:block;" height="x" border="0" width="600">
</a>
</td>
</tr>
</tbody></table>
<!--
INICIO PRODUTOS
-->
<% @news.each do | news |
link = news.at_css('.product_img_link')['href']
link2 = link
zing = Nokogiri::HTML(open(URI.encode(link2)))
price = zing.at_css('.row .center_column .row .our_price_display').text.delete('^0-9,')
pricedesc = price.gsub(',','.').to_s.to_f*0.4
pricedesc2 = pricedesc.to_f.round(2).to_s.gsub('.',',')
%>
<table align="center" border="0" cellpadding="0" cellspacing="3" width="600">
<tbody><tr style="font-family:Arial,sans-serif;font-size:12px;"></tr><tr style="font-family:Arial,sans-serif;font-size:12px;"><td style="border:1px solid #e0e0e0;" height="300" width="300">
<table align="center" border="0" cellpadding="6" cellspacing="0" width="190">
<tbody><tr>
<td style="height:170px;text-align:center;" height="170" align="center">
<a title="" style="text-decoration:none;color:#888;" href="<%= news.at_css('.product_img_link')['href'] %>" target="_blank"> <img style="width:170px;min-height:170px;border:none;" src="<%=zing.at_css('.row .center_column li a')['href']%>" alt="" height="170" width="170"></a>
</td>
</tr>
<tr>
<td style="height:35px;text-align:left;font-family:Arial,sans-serif;font-size:12px;color:#666;border-bottom:1px solid #e0e0e0;" height="30"><%=zing.at_css('.row .center_column .row h1').text %>
</td>
</tr>
</tbody></table>
<table height="49" bgcolor="#fff" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td style="font-family:Arial,sans-serif;font-size:14px;color:#333;background:#fff;text-align:left;padding:7px 0 0 10px;">DP</td>
<td style="text-align:right;font-family:Arial,sans-serif;font-size:14px;color:#333;background:#fff;padding:7px 7px 0 0;">
<%=pricedesc.to_f.round(2).to_s.gsub('.',',') %>
</td>
<td style="text-align:center;background:#fff;font-family:Arial,sans-serif;font-size:14px;color:#a0a4ab;padding-top:7px;" width="65">
-60%
</td>
</tr>
<tr>
<td style="font-family:Arial,sans-serif;font-size:12px;color:#999;background:#fff;text-align:left;padding-left:10px;">
RP
</td>
<td style="text-align:right;font-family:Arial,sans-serif;font-size:12px;color:#999;text-decoration:line-through;background:#fff;padding-right:7px;">
39.65 €
</td>
<td style="text-align:center;background:#fff;padding-top:3px;" align="right">
<a title="" style="text-decoration:none;color:#888;" href="<%= news.at_css('.product_img_link')['href'] %>" target="_blank"><img style="border:none;" alt="" src="https://dub119.mail.live.com/Handlers/ImageProxy.mvc?bicild=&amp;canary=f%2bi7zrJk07ssdltxI4H8ZvUPmVw6tb%2fuMLBpdyvKVAQ%3d0&amp;url=http%3a%2f%2fnewsletter.edropshipping.net%2f2014%2fautomatizar%2fbtn_img%2fcart_btn.png" height="29" width="55"></a>
</td>
</tr>
</tbody></table>
</td>
</tbody></table>
<% end
%>
</tbody></table></td></tr></tbody></table></div>
</div>
<!-- FIM PRODUTOS
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment