Extract Ernst Hemingway Quotes from Goodreads

Here's a fast and simple process to extract Ernst Hemingway Quotes from Goodreads. The process is not done, I still need to loop over each quote and add 1 day to the %{now} macro. The goal is to then write them in markdown with %{now}+1 day and auto schedule them on my other website (thomasott.io).

Right now the Goodreads.com <http://goodreads.com>__ web structure is easy to extract but I suspect they'll make it harder one day.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;process version="8.1.000"&gt;
  &lt;context&gt;
    &lt;input/&gt;
    &lt;output/&gt;
    &lt;macros/&gt;
  &lt;/context&gt;
  &lt;operator activated="true" class="process" compatibility="8.1.000" expanded="true" name="Process"&gt;
    &lt;process expanded="true"&gt;
      &lt;operator activated="true" class="generate_data_user_specification" compatibility="8.1.000" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="45" y="34"&gt;
        &lt;list key="attribute_values"&gt;
          &lt;parameter key="get_date" value="date_now()"/&gt;
        &lt;/list&gt;
        &lt;list key="set_additional_roles"/&gt;
      &lt;/operator&gt;
      &lt;operator activated="true" class="date_to_nominal" compatibility="8.1.000" expanded="true" height="82" name="Date to Nominal" width="90" x="179" y="34"&gt;
        &lt;parameter key="attribute_name" value="get_date"/&gt;
        &lt;parameter key="date_format" value="yyyy-MM-dd"/&gt;
      &lt;/operator&gt;
      &lt;operator activated="true" class="extract_macro" compatibility="8.1.000" expanded="true" height="68" name="Extract Macro" width="90" x="313" y="34"&gt;
        &lt;parameter key="macro" value="now"/&gt;
        &lt;parameter key="macro_type" value="data_value"/&gt;
        &lt;parameter key="attribute_name" value="get_date"/&gt;
        &lt;parameter key="example_index" value="1"/&gt;
        &lt;list key="additional_macros"/&gt;
      &lt;/operator&gt;
      &lt;operator activated="true" class="web:get_webpage" compatibility="7.3.000" expanded="true" height="68" name="Get Page" width="90" x="447" y="34"&gt;
        &lt;parameter key="url" value="https://www.goodreads.com/work/quotes/2459084-a-moveable-feast"/&gt;
        &lt;list key="query_parameters"/&gt;
        &lt;list key="request_properties"/&gt;
        &lt;description align="center" color="transparent" colored="false" width="126"&gt;Read Moveable Feast Quotes&lt;/description&gt;
      &lt;/operator&gt;
      &lt;operator activated="true" class="text:cut_document" compatibility="8.1.000" expanded="true" height="68" name="Cut Document" width="90" x="581" y="34"&gt;
        &lt;list key="string_machting_queries"&gt;
          &lt;parameter key="MoveableFeastQuotes" value="&lt;div class=&amp;quot;quoteText&amp;quot;&gt;.&lt;/div&gt;"/&gt;
        &lt;/list&gt;
        &lt;list key="regular_expression_queries"/&gt;
        &lt;list key="regular_region_queries"/&gt;
        &lt;list key="xpath_queries"&gt;
          &lt;parameter key="&lt;div class =&amp;quot;quoteText&amp;quot;&gt;" value="&lt;/div&gt;"/&gt;
        &lt;/list&gt;
        &lt;list key="namespaces"/&gt;
        &lt;list key="index_queries"/&gt;
        &lt;list key="jsonpath_queries"/&gt;
        &lt;process expanded="true"&gt;
          &lt;operator activated="true" class="web:extract_html_text_content" compatibility="7.3.000" expanded="true" height="68" name="Extract Content" width="90" x="45" y="34"/&gt;
          &lt;operator activated="true" class="text:extract_information" compatibility="8.1.000" expanded="true" height="68" name="Extract Information" width="90" x="179" y="34"&gt;
            &lt;parameter key="query_type" value="Regular Expression"/&gt;
            &lt;list key="string_machting_queries"&gt;
              &lt;parameter key="QuoteText" value="&amp;quot;.&amp;quot;"/&gt;
            &lt;/list&gt;
            &lt;list key="regular_expression_queries"&gt;
              &lt;parameter key="QuoteText" value="\&amp;quot;.*\&amp;quot;"/&gt;
            &lt;/list&gt;
            &lt;list key="regular_region_queries"/&gt;
            &lt;list key="xpath_queries"/&gt;
            &lt;list key="namespaces"/&gt;
            &lt;list key="index_queries"/&gt;
            &lt;list key="jsonpath_queries"/&gt;
          &lt;/operator&gt;
          &lt;operator activated="true" class="text:documents_to_data" compatibility="8.1.000" expanded="true" height="82" name="Documents to Data" width="90" x="313" y="34"&gt;
            &lt;parameter key="text_attribute" value="ExtractedText"/&gt;
          &lt;/operator&gt;
          &lt;operator activated="true" class="extract_macro" compatibility="8.1.000" expanded="true" height="68" name="Extract Quote" width="90" x="447" y="34"&gt;
            &lt;parameter key="macro" value="Quote"/&gt;
            &lt;parameter key="macro_type" value="data_value"/&gt;
            &lt;parameter key="attribute_name" value="ExtractedText"/&gt;
            &lt;parameter key="example_index" value="1"/&gt;
            &lt;list key="additional_macros"/&gt;
          &lt;/operator&gt;
          &lt;operator activated="true" class="text:create_document" compatibility="8.1.000" expanded="true" height="68" name="Create Document" width="90" x="648" y="34"&gt;
            &lt;parameter key="text" value="Title: Hemingway Quote for %{now}&amp;#10;Date: %{now}&amp;#10;&amp;#10;#Hemingway Quote for %{now}&amp;#10;&amp;#10;%{Quote}"/&gt;
          &lt;/operator&gt;
          &lt;connect from_port="segment" to_op="Extract Content" to_port="document"/&gt;
          &lt;connect from_op="Extract Content" from_port="document" to_op="Extract Information" to_port="document"/&gt;
          &lt;connect from_op="Extract Information" from_port="document" to_op="Documents to Data" to_port="documents 1"/&gt;
          &lt;connect from_op="Documents to Data" from_port="example set" to_op="Extract Quote" to_port="example set"/&gt;
          &lt;connect from_op="Create Document" from_port="output" to_port="document 1"/&gt;
          &lt;portSpacing port="source_segment" spacing="0"/&gt;
          &lt;portSpacing port="sink_document 1" spacing="0"/&gt;
          &lt;portSpacing port="sink_document 2" spacing="0"/&gt;
        &lt;/process&gt;
      &lt;/operator&gt;
      &lt;connect from_op="Generate Data by User Specification" from_port="output" to_op="Date to Nominal" to_port="example set input"/&gt;
      &lt;connect from_op="Date to Nominal" from_port="example set output" to_op="Extract Macro" to_port="example set"/&gt;
      &lt;connect from_op="Get Page" from_port="output" to_op="Cut Document" to_port="document"/&gt;
      &lt;connect from_op="Cut Document" from_port="documents" to_port="result 1"/&gt;
      &lt;portSpacing port="source_input 1" spacing="0"/&gt;
      &lt;portSpacing port="sink_result 1" spacing="0"/&gt;
      &lt;portSpacing port="sink_result 2" spacing="0"/&gt;
    &lt;/process&gt;
  &lt;/operator&gt;
&lt;/process&gt;
Show Comments