extract XML RSS etc by tags such as or <code> or <description> </h1> <div class="" title="Click to select this command" style="position:relative;border:1px dotted #ccc;border-radius:3px"> <span class="glyphicon glyphicon-usd" style="position:absolute;color:white;padding:.5em;font-size:85%;top:6px;"></span> <span style="padding-left:2em;font-weight:bold" class="command code bash">curl ${URL} 2>/dev/null|grep "<${BLOCK}>"|sed -e "s/.*\<${BLOCK}\>\(.*\)\<\/${BLOCK}\>.*/\1/g"</span> </div> <div class="description"> set BLOCK to "title" or any other HTML / RSS / XML tag and curl URL to get everything in-between e.g. some text </div> </div> <div class="col-md-4 col-lg-3" style="padding-top:10px"> <div class="votes"> <div class="pull-right voting-options" style="display:inline-block;margin-right:5px"> <a href="javascript:void(0)" class="vote-button"><i id="vote-up-12671" class="glyphicon glyphicon-chevron-up"></i></a><br/> <a href="javascript:void(0)" class="vote-button"><i id="vote-down-12671" class="glyphicon glyphicon-chevron-down"></i></a> </div> <div style="position:absolute;top:13px;right:1.3em;display:inline-block;" class="num-votes" id="num-votes-12671">0</div> <div class="clearfix"></div> </div> <div class="author" style="text-align:right"> By: <a href="/commands/by/c3w">c3w</a> </div> <div class="date" style="text-align:right"> 2013-08-31 14:53:54 </div> <div class="functions text-right"> <a href="/commands/using/grep">grep</a> <a href="/commands/using/sed">sed</a> <a href="/commands/tagged/34/bash">bash</a> <a href="/commands/tagged/235/curl">curl</a> <a href="/commands/tagged/351/regex">regex</a> <a href="/commands/tagged/501/html">html</a> <a href="/commands/tagged/653/xml">xml</a> <a href="/commands/tagged/737/rss">rss</a> <a href="/commands/tagged/2542/newsfeed">newsfeed</a> </div> <div class="text-right"> <span class="pull-right"> <a class="text-muted" href="#comment"> <span class="glyphicon glyphicon-comment"></span> 0</a> </span> <span class="pull-right" style="margin-right: 1em;"> <a class="favourite-link" href="javascript:void(0)"><i id="toggle-favourite-12671" class="glyphicon glyphicon-star-empty"></i></a> </span> </div> </div> <div class="col-md-12"> </div> <div class="btn-group" style="position:absolute;right:22px;margin-top:10px;cursor:pointer;"> <a class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="glyphicon glyphicon-option-vertical"></span> </a> <ul class="dropdown-menu"> <li><a href="/commands/edit/0/12671" title="Submit a superior alternative">Submit alternative</a></li> <li role="separator" class="divider"></li> <li><a class="report-link" id="report-12671" href="javascript:void(0)" title="Report this command as malicious">Report as malicious</a></li> <li><a href="/commands/duplicate/12671" title="Report as duplicate">Report as a duplicate</a></li> </ul> </div> <!-- <div class="details"> <div class="votes"> <div class="num-votes" id="num-votes-12671">0</div> <div class="voting-options"> <a href="javascript:void(0)" class="vote-button" id="vote-up-12671">Up</a><br/> <a href="javascript:void(0)" class="vote-button" id="vote-down-12671">Down</a> </div> </div> </div> --> </div> </div> <div class="text-center" style="margin-bottom:20px;"> <a style="margin:auto;" class="btn btn-warning" href="/commands/edit/0/12671" >Submit An Alternative</a> </div> <div class="panel panel-default"> <div class="panel-heading" style="background-color:white"> <h3 class="panel-title">What do you think?</h3> <p>Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?</p> </div> <p class="text-center" style="margin:25px;">You must be <a href="/users/signin">signed in</a> to comment.</p> </div> <!--<script> function showspam(){window.location+="?nofilter=1",window.location.reload(!0)}var sf=0;$(document).ready(function(){var e=new URL(document.location).searchParams;"1"===e.get("nofilter")?console.log("spam filter off"):$("div.comment").each(function(){this.getElementsByTagName("a").length>2&&(0===sf?($(this).replaceWith("<div style='background-color:#eee; padding-bottom:10px; padding-left: 15px'><h3>Likely Spam Filtered</h3><p>One or more comments in this thread have been hidden from view. To view them anyway, click <a href='"+window.location+"?nofilter=1' onclick='showspam();'>here</a>.</p></div>"),sf=1):$(this).remove()),this.getElementsByTagName("p")[0].innerHTML.length>10&&this.getElementsByTagName("p")[0].innerHTML.includes("href")&&$(this).remove()})}); </script>--> </div> <div class="col-md-3 col-lg-4"> <div class="box-copy"> <h3 class="righthead">What's this?</h3> <div class="toggleable"> <p><strong>commandlinefu.com</strong> is the place to record those command-line gems that you return to again and again. That way others can gain from your <abbr title="Command-line interface">CLI</abbr> wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down. </p> <p class="text-center"><a class="btn btn-warning" href="/commands/edit"><strong><i class="glyphicon glyphicon-plus"></i> Share Your Commands</strong></a></p> <!-- <p>If you have a new feature suggestion or find a bug, please get in touch via <a href="http://commandlinefu.uservoice.com/"><strong>http://commandlinefu.uservoice.com/</strong></a><p>--> </div> </div> <hr /> <div class="box-copy"> <h3 class="righthead">Similar Commands</h3> <p style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis"> <strong><a href="/commands/view/3008/print-latest-top-10-top-3-or-commandlinefu.com-commands">print latest (top 10, top 3 or *) commandlinefu.com commands</a></strong> </p> <p style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis"> <strong><a href="/commands/view/5413/extract-title-from-html-files">Extract title from HTML files</a></strong> </p> <p style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis"> <strong><a href="/commands/view/5403/extract-title-from-html-files">Extract title from HTML files</a></strong> </p> <p style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis"> <strong><a href="/commands/view/5418/extract-title-from-html-files">Extract title from HTML files</a></strong> </p> </div> <hr> <div class="box-copy"> <h3 class="righthead">Stay in the loop…</h3> <div class="toggleable"> <dl> <dt>Follow the Tweets.</dt> <dd> <a href="http://twitter.com/commandlinefu"><img class="link-img" src="/images/twitter.jpg" /></a> <p>Every new command is wrapped in a tweet and posted to <a href="http://twitter.com">Twitter</a>. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.</p> <p> » <a style="font-weight:bold;" href="http://twitter.com/commandlinefu">http://twitter.com/commandlinefu</a><br/> » <a style="font-weight:bold;" href="http://twitter.com/commandlinefu3">http://twitter.com/commandlinefu3</a><br/> » <a style="font-weight:bold;" href="http://twitter.com/commandlinefu10">http://twitter.com/commandlinefu10</a> </p> </dd> <dt>Subscribe to the feeds.</dt> <dd> <a style="font-weight:bold;" href="http://feeds2.feedburner.com/Command-line-fu"><img class="link-img" src="/images/rss.gif" /></a> <p>Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):</p> <p>Subscribe to the feed for:</p> <ul id="feed-links"> <li>» <a style="font-weight:bold;" href="http://feeds2.feedburner.com/Command-line-fu">all commands</a></li> <li>» <a style="font-weight:bold;" href="/feed/threeup">commands with 3 up-votes</a> (commandlinefu3)</li> <li>» <a style="font-weight:bold;" href="/feed/tenup">commands with 10 up-votes</a> (commandlinefu10)</li> </ul> </dd> </dl> </div> </div> <!-- <div class="box-copy"> <a class="visibility-toggle" id="box-copy-tags">Hide</a> <h3>Top Tags</h3> <div class="toggleable"><br> <a href="/commands/tagged/112/awk">awk</a>, <a href="/commands/tagged/34/bash">bash</a></li>, <a href="/commands/tagged/235/curl">curl</a>, <a href="/commands/tagged/123/find">find</a>, <a href="/commands/tagged/163/grep">grep</a>, <a href="/commands/tagged/64/linux">Linux</a>, <a href="/commands/tagged/110/sed">sed</a></li> </ul> </div> </div> <div class="box-copy"> <a class="visibility-toggle" id="box-copy-functions">Hide</a> <h3>Functions</h3> <div class="toggleable"> </div> </div> --> </div> </div> </div> <footer class="bs-footer" role="contentinfo" style="background-color:#F5F5F5;"> <div class="container"> <p style="padding-top:20px;">commandlinefu.com © 2018 <a href="https://www.danstools.com" target="_blank">Dan's Tools</a> | <a href="/site/faq">FAQs</a> | <a href="/site/api">API</a> | <a href="/site/widget">Widget</a> | <a href="/site/privacy">Privacy</a></p> </div> </footer> <!-- <div id="wrapper"> <div id="right-block"> </div> <div id="header"> <h4><a href="/commands/browse" title="commandlinefu.com - the greatest commands on the web"><img src="/images/header-logo.jpg" alt="commandlinefu.com" /></a></h4> <div id="nav"> <strong><a href="/commands/random" title="Lucky dip">Random</a></strong> | <strong><a href="/commands/browse/last-week/sort-by-votes" title="Piping host commands from the last 7 days">Hot this week</a></strong> | <strong><a href="/commands/browse/sort-by-votes" title="See the all-time greatest commands">All-time greats</a></strong> • <strong><a href="/site/faq"><abbr title="Frequently asked questions">FAQ</abbr></a></strong> | <strong><a href="/site/api"><abbr title="API documentation">API</abbr></a></strong> | <strong><a href="/site/widget"><abbr title="Javascript widget">Widget</abbr></a></strong> </div> <div id="search"> <form id="search-form" action="/search/handler" method="post" > <div id="search-container"> <img id="loading" src="/images/tag-loader.gif" style="display:none;float:right;margin: 5px 5px 0 0;" /> <input type="text" id="search-query" class="inactive" name="q" autocomplete="off" value="" placeholder="type here to grep the archive..." /> </div> </form> <div style="display:none" id="search-options"></div> </div> </div> <div id="left-block"> </div> <div id="footer"> <div class="advertising"> </div> </div> </div> --> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script> $.noConflict(); if (typeof Prototype !== "undefined" && Prototype.BrowserFeatures.ElementExtensions) { var disablePrototypeJS = function (method, pluginsToDisable) { var handler = function (event) { event.target[method] = undefined; setTimeout(function () { delete event.target[method]; }, 0); }; pluginsToDisable.each(function (plugin) { jQuery(window).on(method + '.bs.' + plugin, handler); }); }, pluginsToDisable = ['collapse', 'dropdown', 'modal', 'tooltip', 'popover', 'tab','collect']; disablePrototypeJS('show', pluginsToDisable); disablePrototypeJS('hide', pluginsToDisable); } </script> <script> jQuery( document ).ready(function() { hljs.initHighlightingOnLoad(); hljs.configure({useBR: true}); jQuery('span.code').each(function(i, block) { hljs.highlightBlock(block); }); }); </script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> </body> </html>