Automated importing of LoTW users

这个提交包含在:
Peter Goodhall 2014-03-03 17:28:33 +00:00
父节点 06f74f3ed7
当前提交 008471a19d
共有 2 个文件被更改,包括 39 次插入1 次删除

查看文件

@ -4,7 +4,8 @@ class Update extends CI_Controller {
/* /*
Controls Updating Elements of Cloudlog Controls Updating Elements of Cloudlog
Functions: Functions:
dxcc dxcc - imports the latest clublog cty.xml data
lotw_users - imports lotw users
*/ */
public function index() public function index()
@ -160,5 +161,26 @@ class Update extends CI_Controller {
echo "<table>"; echo "<table>";
} }
public function lotw_users() {
// Load Database connectors
$this->load->model('lotw');
$this->lotw->empty_table("lotw_list");
$lines = file('http://www.hb9bza.net/lotw/lotw1.txt');
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
$data = array(
'Callsign' => $line,
);
$this->db->insert('lotw_list', $data);
}
}
} }
?> ?>

16
application/models/lotw.php 普通文件
查看文件

@ -0,0 +1,16 @@
<?php
class LOTW extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function empty_table($table) {
$this->db->empty_table($table);
}
}
?>