potiuk commented on PR #576:
URL: https://github.com/apache/airflow-site/pull/576#issuecomment-1106768099

   OK. This works :)
   
   (and this time I tested if it actually works by removing some lines from the 
pattern file). 
   
   ```
   θ69° [jarek:~/code/airflow-site] [twine] migrate-ga-to-matomo 8s 1 ± git 
diff -U0 HEAD^ | grep '^[+-]' | grep -vF -x -f /tmp/file.txt | grep -v '^---' | 
grep -v '^+++' | wc
         0       0       0
   ```
   
   The pattern file:
   
   ```
   -    <script type="application/javascript">
   -        var doNotTrack = false;
   -        
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
   -        ga('create', 'UA-140539454-1', 'auto');
   -        ga('send', 'pageview');
   -    </script>
   -    <script async 
src='https://www.google-analytics.com/analytics.js'></script>
   +<!-- Matomo -->
   +<script>
   +  var _paq = window._paq = window._paq || [];
   +  _paq.push(['disableCookies']);
   +  _paq.push(['trackPageView']);
   +  _paq.push(['enableLinkTracking']);
   +  (function() {
   +    var u="https://analytics.apache.org/";;
   +    _paq.push(['setTrackerUrl', u+'matomo.php']);
   +    _paq.push(['setSiteId', '13']);
   +    var d=document, g=d.createElement('script'), 
s=d.getElementsByTagName('script')[0];
   +    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
   +  })();
   +</script>
   +<!-- End Matomo -->
   -
   -<script type="application/javascript">
   -window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new 
Date;
   -ga("create", "UA-140539454-1", "auto");
   -ga("send", "pageview");
   -<script async src="https://www.google-analytics.com/analytics.js";></script>
   -  <div class="footer">This page uses <a 
href="https://analytics.google.com/";>
   -    Google Analytics</a> to collect statistics. You can disable it by 
blocking
   -    the JavaScript coming from www.google-analytics.com. Check our
   -    <a href="privacy_notice.html">Privacy Policy</a>
   -    for more details.
   -    <script type="text/javascript">
   -      (function() {
   -        var ga = document.createElement('script');
   -        ga.src = ('https:' == document.location.protocol ?
   -          'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
   -        ga.setAttribute('async', 'true');
   -        var nodes = document.documentElement.childNodes;
   -        var i = -1;
   -        var node;
   -        do {
   -          i++;
   -          node = nodes[i]
   -        } while(node.nodeType !== Node.ELEMENT_NODE);
   -        node.appendChild(ga);
   -      })();
   -  </div>
   -    <script type="text/javascript">
   -    var _gaq = _gaq || [];
   -    _gaq.push(['_setAccount', 'UA-140539454-1']);
   -    _gaq.push(['_trackPageview']);
   -  </script>
   -    <a href="../../../../../privacy_notice.html">Privacy Policy</a>
   -    <a href="../../../../privacy_notice.html">Privacy Policy</a>
   -    <a href="../../../privacy_notice.html">Privacy Policy</a>
   -    <a href="../../privacy_notice.html">Privacy Policy</a>
   -    <a href="../privacy_notice.html">Privacy Policy</a>
   -    <a href="#">Privacy Policy</a>
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to