<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ricardo A. Mercado</title>
    <description>The latest articles on DEV Community by Ricardo A. Mercado (@futoricky).</description>
    <link>https://dev.to/futoricky</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F83639%2Fe8c7ba42-c0b2-407d-9816-d1abdde2de16.jpeg</url>
      <title>DEV Community: Ricardo A. Mercado</title>
      <link>https://dev.to/futoricky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/futoricky"/>
    <language>en</language>
    <item>
      <title>Software is like poetry</title>
      <dc:creator>Ricardo A. Mercado</dc:creator>
      <pubDate>Sun, 06 Jan 2019 21:54:53 +0000</pubDate>
      <link>https://dev.to/futoricky/software-is-like-poetry-1nmp</link>
      <guid>https://dev.to/futoricky/software-is-like-poetry-1nmp</guid>
      <description>&lt;p&gt;When I was in school I used to write a lot of poetry and I remember trying to express a feeling or an emotion in the best possible way I could to project exactly what I wanted it to be. That feeling or emotion could be written in many different ways to express the same message, but as the creator of the content, one’s self looks for the correct words that connect with what your mind is trying to portray and exhibit in the poem. Coding is no different to this.&lt;/p&gt;

&lt;p&gt;When you are writing code you are creating software that has the goal of accomplishing something. That something represents the expression or projection you, as the creator, want to achieve with writing the code for that software. And that something is going to be coded/written the way your mind is trying to portray the behavior of that software to accomplish that “something”, the same process when writing a poem.&lt;/p&gt;

&lt;p&gt;Poetry can be written in many different languages.&lt;br&gt;
&lt;code&gt;Software can be written in many different languages.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Poetry is written to express a message or stimulate an emotion. It is written to achieve something.&lt;br&gt;
&lt;code&gt;Software is written to complete a task or produce a result. It is written to achieve something.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Poetry can be written in a infinite of different ways and express the same message or stimulate the same emotion.&lt;br&gt;
&lt;code&gt;Software can be written in an infinite of different ways and complete the same task or produce the same result.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Poetry can be poorly written and can also fail in expressing the message or stimulating the emotion.&lt;br&gt;
&lt;code&gt;Software can be poorly written and can also fail in completing the task or producing the result.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the end, both practices, writing poems and coding software, require a creator with the ability to express whatever he or she wants to achieve exactly how it is manufactured in the mind. These arts that manifest themselves as opposites, emotion and logic, so I feel that if a person practices one, they should consider practicing the other to create a balance in perspective and/or thinking process, as well as embracing the duality of all that is executed in life.&lt;/p&gt;

</description>
      <category>software</category>
      <category>poetry</category>
    </item>
    <item>
      <title>How I made a web scraper because LinkedIn</title>
      <dc:creator>Ricardo A. Mercado</dc:creator>
      <pubDate>Wed, 26 Dec 2018 19:10:17 +0000</pubDate>
      <link>https://dev.to/futoricky/how-i-made-a-web-scraper-script-because-linkedin-27fc</link>
      <guid>https://dev.to/futoricky/how-i-made-a-web-scraper-script-because-linkedin-27fc</guid>
      <description>&lt;p&gt;Having lots of LinkedIn connections can be convenient for many people. You and your connection agreed to be connected through the platform, thus sharing some public information including your email (in most cases, you can choose not to though). This is all nice and dandy until you actually want to use all the data you have from your connections... Depending on what data you want...&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Let's say you want to export all of your connections' data from LinkedIn, you can do this by following their instructions found &lt;a href="https://www.linkedin.com/help/linkedin/answer/66844/exporting-connections-from-linkedin?lang=en" rel="noopener noreferrer"&gt;here&lt;/a&gt;. It generates a CSV file containing the following information from each connection:&lt;br&gt;
&lt;code&gt;First Name, Last Name, Email Address, Company, Position, Connected On&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So what's the issue here? Well even though it gives you a Email Address column on the csv, it doesn't really provide any of your connections' emails! I guess they used to provided it and never updated the export csv to remove that column. I also checked out their public API and found nothing related you connections emails, but I did find this &lt;a href="https://stackoverflow.com/questions/20970016/linkedin-api-get-information-about-my-all-connections" rel="noopener noreferrer"&gt;StackOverflow discussion&lt;/a&gt; which indicated that they in fact used to provided that info, but now they do not. WTF LinkedIn? So I just decided to just scrape all of my connections' emails. I mean, I can access them manually, but it would take a shit load of time to get all of my 2000+ connection emails.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;What did I need the script to do to achieve this? Well first I needed it to log in, then search the connection's name, enter it's profile page, and get the email. Simple... right?&lt;/p&gt;

&lt;h3&gt;
  
  
  1st Attempt
&lt;/h3&gt;

&lt;p&gt;By using LinkedIn's search input getting the emails was working until they semi-blocked my account for suspicious behavior due to too many search requests. This was about 500 connections in.&lt;/p&gt;

&lt;h3&gt;
  
  
  2nd Attempt
&lt;/h3&gt;

&lt;p&gt;Maybe I just have to be more careful with the amount of searches between x amount of time. So I added the option to set an interval (default to 1 hour) and to set the amount of emails to search between each interval (default to 50). &lt;/p&gt;

&lt;p&gt;LinkedIn are some sneaky bastards, they semi-blocked me again! I searched for information on this semi-blocking and found that is specifically designed to avoid automated bots to do stuff on the site. Great....&lt;/p&gt;

&lt;h3&gt;
  
  
  3rd Attempt
&lt;/h3&gt;

&lt;p&gt;I thought that maybe the search limit only applied to general searches, so let's try clicking directly on the connection when it appears on the suggestion box that appears after typing in the connection's name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F20invw1pwwf9u91fb85g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F20invw1pwwf9u91fb85g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, turns out the library I'm using to scrape the page (&lt;a href="https://github.com/segmentio/nightmare" rel="noopener noreferrer"&gt;NightmareJS&lt;/a&gt;) did not detect that DOM element, so I couldn't do anything with it. sigh....&lt;/p&gt;

&lt;h3&gt;
  
  
  4th and Final Attempt
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgpmhsa1wap0upccvpj7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgpmhsa1wap0upccvpj7q.png"&gt;&lt;/a&gt;&lt;br&gt;
After some head scratching and some thought to just quit the little project I finally came up with another approach... Going directly to my connections section, and using the connections search input, which only searches my connections. And this finally worked with no search limit!!&lt;/p&gt;

&lt;p&gt;After all emails are scraped I just create a &lt;code&gt;email.txt&lt;/code&gt; file with all the emails in there. And that was it!&lt;/p&gt;

&lt;p&gt;TL;DR&lt;br&gt;
I wanted to get all of my LinkedIn connections' emails. LinkedIn does not allow an option to retrieve them by exporting your connections data, so I created a web scraper to get them.&lt;/p&gt;

&lt;p&gt;For anyone interested in checking out the script, you can access it &lt;a href="https://github.com/FutoRicky/linkedin-email-extractor" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  NOTE
&lt;/h3&gt;

&lt;p&gt;If LinkedIn updates their page and changes the class of an element used in the script it will stop working. You can check out the source code and verify if any class has changed on LinkedIn and update the script to make it work again.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>script</category>
      <category>webscraper</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
