<?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: Ganesh Bagaria</title>
    <description>The latest articles on DEV Community by Ganesh Bagaria (@ganofins).</description>
    <link>https://dev.to/ganofins</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%2F216004%2F0b319a1e-5598-4079-beae-d5bef211d1aa.jpeg</url>
      <title>DEV Community: Ganesh Bagaria</title>
      <link>https://dev.to/ganofins</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganofins"/>
    <language>en</language>
    <item>
      <title>How to enable or disable the touchscreen in Manjaro or Arch Linux?</title>
      <dc:creator>Ganesh Bagaria</dc:creator>
      <pubDate>Tue, 04 Feb 2020 15:57:49 +0000</pubDate>
      <link>https://dev.to/ganofins/how-to-enable-or-disable-the-touchscreen-in-manjaro-or-arch-linux-4ge9</link>
      <guid>https://dev.to/ganofins/how-to-enable-or-disable-the-touchscreen-in-manjaro-or-arch-linux-4ge9</guid>
      <description>&lt;p&gt;In this post I will tell you how to enable or disable the touchscreen in Manjaro or Arch Linux?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Several times graphical tools doesn't work or we don't like to waste our time just to lookout for them.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For that purpose, we will use &lt;strong&gt;Xinput&lt;/strong&gt;. It is a utility to configure and test X input devices, such as mouses, keyboards, touchpads, etc.&lt;/p&gt;

&lt;p&gt;If Xinput is not already installed. Then you can install it using&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;sudo pacman -S xorg-xinput&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;command.&lt;/p&gt;

&lt;p&gt;There are several operations which you can perform using &lt;a href="https://www.x.org/archive/current/doc/man/man1/xinput.1.xhtml"&gt;Xinput&lt;/a&gt; utility. Now to disable the touchscreen.&lt;/p&gt;

&lt;p&gt;First, run &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;xinput list --long&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;command in your terminal.&lt;/p&gt;

&lt;p&gt;Above command's output will be like this -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ob5QYvbm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-XrUs2toHKVc/XjmMK3FQK9I/AAAAAAAAAs0/JBffLDG1tpk-ztmzZbDegXnFIDLnBE7dgCLcBGAsYHQ/s1600/b1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ob5QYvbm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-XrUs2toHKVc/XjmMK3FQK9I/AAAAAAAAAs0/JBffLDG1tpk-ztmzZbDegXnFIDLnBE7dgCLcBGAsYHQ/s1600/b1.png" alt="Xinput list --long"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Through which you will get the list of all of your input devices. Now from that list, find your touchscreen device which will be listed in pointer category.&lt;/p&gt;

&lt;p&gt;After that you just need to run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;xinput disable/enable &lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;xinput disable/enable &amp;lt;"device_name"&amp;gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;command.&lt;/p&gt;

&lt;p&gt;But this change will not last permanently. I mean when you will restart your PC, the touchscreen will start working again if you used disable command or vice-versa.&lt;/p&gt;

&lt;p&gt;So, to make the changes permanent. We will add this command to run every time when the system starts-up.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**There is another way to make the changes permanent via Xorg configuration file. I tried using it but I messed up. Lemme know if anybody knows how to make the changes permanent using Xorg config file.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thus,&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Below steps are based on KDE Plasma Desktop Environment.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your System Settings. Go to Start up and Shutdown option.&lt;/li&gt;
&lt;li&gt;Go to Auto start tab.&lt;/li&gt;
&lt;li&gt;There you just need to add a Desktop file with the appropriate command in it.&lt;/li&gt;
&lt;li&gt;Then just Save it or click OK.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's done.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ld7opJH9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-0aTB__8DazA/XjmMu-VlsDI/AAAAAAAAAs8/PGtnD70BlXwBI3NP79raHESHAWnzsdGpACLcBGAsYHQ/s1600/b2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ld7opJH9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-0aTB__8DazA/XjmMu-VlsDI/AAAAAAAAAs8/PGtnD70BlXwBI3NP79raHESHAWnzsdGpACLcBGAsYHQ/s1600/b2.png" alt="Manjaro KDE System Settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to give me any suggestions regarding this blog or the post's format.&lt;/p&gt;

&lt;p&gt;Don't forget to visit my blog to get more posts like this &lt;a href="https://ganofins.com/blog"&gt;ganofins.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>manjaro</category>
      <category>archlinux</category>
      <category>xinput</category>
      <category>inputdevices</category>
    </item>
    <item>
      <title>How to Scrape a website using PHP?</title>
      <dc:creator>Ganesh Bagaria</dc:creator>
      <pubDate>Tue, 28 Jan 2020 06:38:04 +0000</pubDate>
      <link>https://dev.to/ganofins/how-to-scrape-a-website-using-php-aon</link>
      <guid>https://dev.to/ganofins/how-to-scrape-a-website-using-php-aon</guid>
      <description>&lt;p&gt;Hey Guys, Today I will tell you how you can scrape a website using PHP language. To scrape a website using PHP you need to include &lt;a href="https://goo.gl/VzWSmd"&gt;simple_html_dom.php&lt;/a&gt; file in your PHP file. This file contains predefined functions to parse the html website or to search through the tags of that site. Keep in mind Scraping a website without the site’s permission can be considered illegal.&lt;/p&gt;

&lt;p&gt;*This post is just for Educational Purpose.&lt;/p&gt;

&lt;p&gt;First choose the website and the data on it which you want to Scrape. Here I am taking the example of &lt;a href="https://androidheadlines.com"&gt;AndroidHeadlines.com&lt;/a&gt; site. From it we are going to scrape the Latest Headlines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ktDuv_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1152/1%2APvbd5i2iGJSUo3C1yHqfvQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ktDuv_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1152/1%2APvbd5i2iGJSUo3C1yHqfvQ.png" alt="AndroidHeadlines Site Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1 : First you need to start the PHP tags–&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2 : Second include the simple_html_dom file in your PHP code and place that file into the same folder –&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3 : Now create a variable which will contain a method named as file_get_html (this method will create the Document Object Model for the URL provided by the user inside it’s parenthesis) –&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4 : Now by using the variable $html, we can find the site’s tag. So let’s find the tag which contains all the latest posts. For finding the tag inside the $html variable we will use find() function –&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nt2sqqy2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2ABRZkdiL_T97_QnEPQVy2iw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nt2sqqy2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2ABRZkdiL_T97_QnEPQVy2iw.png" alt="AndroidHeadlines Screenshot with inspect elements"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5 : As we only want to scrape the title of the headline and there being multiple headlines, we need to create an array to store all these headlines –&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6 : Now we are going to find the tag which contains the title of the headline. As you can see the span tag contains the title. So, just scrape it and don’t write any index at the end. Now we can directly save it to our titles array –&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mkbawgx9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2AkgJj80NHHMZVQeSRWThurA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mkbawgx9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2AkgJj80NHHMZVQeSRWThurA.png" alt="AndroidHealines Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 7 : Now to print the array titles use foreach or any other loop –&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 8 : Finally, You’ll obtain the scraped data as output in the following manner –&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rBbMwvWp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2ASr7Vt6KjBm1T3zu2f5CpRQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rBbMwvWp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/2049/1%2ASr7Vt6KjBm1T3zu2f5CpRQ.png" alt="Scrapped Array Result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope now you know how to actually scrape data from a website. Feel free to ask any question.&lt;/p&gt;

&lt;p&gt;Don't forget to visit my blog to get more posts like this &lt;a href="https://ganofins.com/blog"&gt;ganofins.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>scraping</category>
      <category>crawling</category>
      <category>webcrawling</category>
    </item>
  </channel>
</rss>
