From ac858f4bd4fcb9c65cbc7b19288cdad0076aa072 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 3 Nov 2014 01:06:02 -0800 Subject: provide example import script --- include/Import/Importer.php | 94 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 include/Import/Importer.php (limited to 'include/Import/Importer.php') diff --git a/include/Import/Importer.php b/include/Import/Importer.php new file mode 100644 index 000000000..c42344236 --- /dev/null +++ b/include/Import/Importer.php @@ -0,0 +1,94 @@ +credentials = $this->get_credentials(); + $this->itemlist = $this->get_itemlist(); + if($this->itemlist) { + $this->src_items = array(); + $this->items = array(); + $cnt = 0; + foreach($this->itemlist as $item) { + $ident = $item->get_item_ident($item); + $this->src_items[$ident]['item'] = $this->get_item($ident); + $this->src_items[$ident]['taxonomy'] = $this->get_taxonomy($ident); + $this->src_items[$ident]['children'] = $this->get_children($ident); + $this->items[$cnt]['item'] = $this->convert_item($ident); + $this->items[$cnt]['item']['term'] = $this->convert_taxonomy($ident); + if($this->src_items[$ident]['children']) { + $this->items[$cnt]['children'] = array(); + foreach($this->src_items[$ident]['children'] as $child) { + $this[$cnt]['children'][] = $this->convert_child($child); + } + } + $cnt ++; + } + + + + + } + + + + + + + } + + +} \ No newline at end of file -- cgit v1.2.3