From 16190a4212b6801a8072dcd2ea16789c6d3ad67b Mon Sep 17 00:00:00 2001
From: TonyFord <tonyford@strategy-investor.de>
Date: Wed, 5 Feb 2020 14:01:42 +0100
Subject: [PATCH] add pull

---
 _config.yml          |  4 +++-
 pull.php             | 10 ++++++++++
 script/get_orders.py | 21 +++++++++++++++++++--
 script/get_prices.py |  2 +-
 4 files changed, 33 insertions(+), 4 deletions(-)
 create mode 100644 pull.php

diff --git a/_config.yml b/_config.yml
index 94de8e7..c21ff6f 100644
--- a/_config.yml
+++ b/_config.yml
@@ -10,7 +10,7 @@ title:
 -
   de: "P2P Marktplatz"
   en: "P2P marketplace"
-url: "https://faircoin.co"
+baseurl: "https://exchange.faircoin.co/p2p/1"
 github_username:  "tonyford"
 color_theme:  "rgb(15, 21, 57)"
 color_text:  "#fff"
@@ -29,3 +29,5 @@ plugins_dir:
 
 exclude:
   - script
+
+destination: ../1
diff --git a/pull.php b/pull.php
new file mode 100644
index 0000000..ce60960
--- /dev/null
+++ b/pull.php
@@ -0,0 +1,10 @@
+<?php
+$repo=$_GET['repo'];
+if( !empty($repo) ){
+	$f='pull.yml';
+	echo $rep.' added to the list! Update regulary every 5 minutes';
+	$fp=fopen($f,'a+');
+	fwrite( $fp, '- '.$repo );
+	fclose( $fp );
+}
+?>
diff --git a/script/get_orders.py b/script/get_orders.py
index 96d56bf..5598f8e 100644
--- a/script/get_orders.py
+++ b/script/get_orders.py
@@ -5,6 +5,10 @@ import re
 import os
 import shutil
 
+pullfile='../../1/pull.yml'
+
+if not os.path.exists(pullfile):
+    sys.exit(0)
 
 try:
     shutil.rmtree('../_posts')
@@ -30,7 +34,18 @@ file.close()
 
 Sources=load( s, Loader=Loader )['sources']
 
-for source in Sources:
+
+file = open( pullfile ,'r')
+s=file.read()
+file.close()
+
+Pulls=load( s, Loader=Loader )
+ 
+
+for source in Pulls:
+
+    if not source in Sources:
+        continue
 
     G=source.split('/')
     gituser=G[-2]
@@ -57,4 +72,6 @@ for source in Sources:
         file.write('\n---')
         file.close()
 
-        print( contents )
+os.remove(pullfile)
+
+
diff --git a/script/get_prices.py b/script/get_prices.py
index 9646601..87fe54a 100644
--- a/script/get_prices.py
+++ b/script/get_prices.py
@@ -7,7 +7,7 @@ import datetime
 Date=datetime.datetime.now().strftime('%Y-%m-%d')
 
 
-file = open('../_site/price-sources.json','r')
+file = open('../../1/price-sources.json','r')
 j=file.read()
 file.close()
 
-- 
GitLab