티스토리 뷰

<전송 블럭 : Python>

        data1 = {
            'RequestType': 'InsertArticles',
            'KeywordID': keywordID,
            'Tablename':tableName,
            'CollectedArticles':json.dumps(articleList)
        }
        res1 = requests.post(self.ServerURL, headers=self.REQUESTHEADER, data=data1)

 

<수신 블럭 : PHP>

			echo "Inserting articles ...<br>";
			$KeywordID = $_POST['KeywordID'];
			$Tablename = $_POST['Tablename'];
			$Datas1 = $_POST['CollectedArticles'];
			$Datas1J = json_decode($Datas1, true);
			foreach($Datas1J as $data1j){
				$AI1 = new cArticleInfo();
				$AI1->TABLENAME = $Tablename;
				$AI1->URLAddress = $data1j['address'];
				$AI1->KeywordID = $KeywordID;
				$rst2 = $AI1->LoadArticles($conn0);
				if($rst2 != NULL) continue;
				$AI2 = new cArticleInfo();
				$AI2->TABLENAME = $Tablename;
				$AI2->SetValuesbyJSON($data1j, $KeywordID);
				$AI2->InsertArticle($conn0);
			}
반응형
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함