title: Network Monitor: Don't Show Same Line Immediately Twice
body: <p>I am building a networking monitoring script in bash. The base command is:</p>
  
  <pre><code>sudo ettercap -T -M ARP -i en1 /// | egrep --color Referer:
  </code></pre>
  
  <p>My output looks like</p>
  
  <pre><code>* |==================================================&gt;| 100.00 %
  
  Referer: http://www.apple.com/.
  Referer: http://www.apple.com/.
  Referer: http://www.apple.com/.
  Referer: http://www.apple.com/.
  Referer: http://www.apple.com/diversity/.
  </code></pre>
  
  <p>My desired output is:</p>
  
  <pre><code>* |==================================================&gt;| 100.00 %
  
  Title: Apple
  URL: http://www.apple.com/
  
  Title: Apple - Diversity - Inclusion inspires innovation.
  URL: http://www.apple.com/diversity/
  </code></pre>
  
  <p>Notice: <code>.</code> at the end of a Referer is no longer there, <code>Referer</code> is changed to <code>URL</code>, <code>Title</code> is added based on title of HTML page and there is a new line every <code>Title</code> <code>URL</code> pair. In my <a href="https://stackoverflow.com/questions/32174907/parse-output-of-command-into-variable-live-network-traffic-monitoring">previous question</a>, I was provided with a perl script to do something along these lines, however <code>ettercap</code> didn't always show a <code>Host:</code> and <code>GET</code> line, so I am retrying with it's constant <code>Referer</code> line. I am not familiar with perl at all, so I am unable to edit myself. <strong>If you could comment what everything does, that would make it easier for me to learn.</strong></p>
  
  <p><strong>Any help is greatly appreciated, thanks!</strong></p>