wordpress-exporter 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +8 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +7 -0
  7. data/Gemfile.lock +75 -0
  8. data/LICENSE +22 -0
  9. data/README.md +71 -0
  10. data/Rakefile +8 -0
  11. data/bin/wordpress-exporter +46 -0
  12. data/lib/cli.rb +11 -0
  13. data/lib/configuration.rb +28 -0
  14. data/lib/converters/content_types_structure_creator.rb +58 -0
  15. data/lib/converters/contentful_model_to_json.rb +119 -0
  16. data/lib/converters/markup_converter.rb +35 -0
  17. data/lib/migrator.rb +30 -0
  18. data/lib/version.rb +3 -0
  19. data/lib/wordpress/blog.rb +83 -0
  20. data/lib/wordpress/category.rb +54 -0
  21. data/lib/wordpress/export.rb +30 -0
  22. data/lib/wordpress/post.rb +94 -0
  23. data/lib/wordpress/post_attachment.rb +44 -0
  24. data/lib/wordpress/post_category_domain.rb +71 -0
  25. data/lib/wordpress/tag.rb +56 -0
  26. data/spec/fixtures/blog/assets/attachment_post/attachment_post_15.json +5 -0
  27. data/spec/fixtures/blog/assets/attachment_post/attachment_post_21.json +5 -0
  28. data/spec/fixtures/blog/entries/blog/blog_1.json +62 -0
  29. data/spec/fixtures/blog/entries/category/category_11599757.json +5 -0
  30. data/spec/fixtures/blog/entries/category/category_14786.json +5 -0
  31. data/spec/fixtures/blog/entries/category/category_2214351.json +5 -0
  32. data/spec/fixtures/blog/entries/category/category_8076.json +5 -0
  33. data/spec/fixtures/blog/entries/post/post_1.json +7 -0
  34. data/spec/fixtures/blog/entries/post/post_11.json +31 -0
  35. data/spec/fixtures/blog/entries/post/post_15.json +11 -0
  36. data/spec/fixtures/blog/entries/post/post_21.json +11 -0
  37. data/spec/fixtures/blog/entries/post/post_3.json +13 -0
  38. data/spec/fixtures/blog/entries/post/post_5.json +13 -0
  39. data/spec/fixtures/blog/entries/post/post_9.json +13 -0
  40. data/spec/fixtures/blog/entries/tag/tag_2656354.json +5 -0
  41. data/spec/fixtures/blog/entries/tag/tag_306830130.json +5 -0
  42. data/spec/fixtures/default_contentful_structure.json +78 -0
  43. data/spec/fixtures/wordpress.xml +551 -0
  44. data/spec/lib/configuration_spec.rb +23 -0
  45. data/spec/lib/converters/markup_converter_spec.rb +27 -0
  46. data/spec/lib/wordpress/blog_spec.rb +64 -0
  47. data/spec/lib/wordpress/category_spec.rb +39 -0
  48. data/spec/lib/wordpress/export_spec.rb +27 -0
  49. data/spec/lib/wordpress/post_category_domain_spec.rb +41 -0
  50. data/spec/lib/wordpress/post_spec.rb +41 -0
  51. data/spec/lib/wordpress/tag_spec.rb +39 -0
  52. data/spec/spec_helper.rb +13 -0
  53. data/spec/support/db_rows_json.rb +5 -0
  54. data/spec/support/shared_configuration.rb +13 -0
  55. data/wordpress_exporter.gemspec +33 -0
  56. data/wordpress_settings/contentful_model.json +288 -0
  57. data/wordpress_settings/contentful_structure.json +78 -0
  58. data/wordpress_settings/default_contentful_structure.json +78 -0
  59. data/wordpress_settings/export_wordpress.xml +380 -0
  60. data/wordpress_settings/wordpress.xml +570 -0
  61. data/wordpress_settings/wordpress_settings.yml +13 -0
  62. metadata +288 -0
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+ require 'yaml'
3
+
4
+ module Contentful
5
+ describe Configuration do
6
+ it 'initialize' do
7
+ yaml_text = <<-EOF
8
+ data_dir: path_to_data_dir
9
+ wordpress_xml_path: path_to_xml_file.xml
10
+ contentful_structure_dir: spec/fixtures/default_contentful_structure.json
11
+ EOF
12
+
13
+ yaml = YAML.load(yaml_text)
14
+ configuration = Contentful::Configuration.new(yaml)
15
+
16
+ expect(configuration.assets_dir).to eq 'path_to_data_dir/assets'
17
+ expect(configuration.collections_dir).to eq 'path_to_data_dir/collections'
18
+ expect(configuration.data_dir).to eq 'path_to_data_dir'
19
+ expect(configuration.entries_dir).to eq 'path_to_data_dir/entries'
20
+ expect(configuration.wordpress_xml).to eq 'path_to_xml_file.xml'
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+ require './lib/converters/markup_converter'
3
+ require 'logger'
4
+
5
+ module Contentful
6
+ module Converter
7
+ describe MarkupConverter do
8
+ include_context 'shared_configuration'
9
+
10
+ before do
11
+ @converter = MarkupConverter.new(@settings)
12
+ end
13
+
14
+ it 'convert_markup_to_markdown' do
15
+ expect_any_instance_of(MarkupConverter).to receive(:convert_post_content).exactly(7).times
16
+ @converter.convert_markup_to_markdown
17
+ end
18
+
19
+ it 'convert post content' do
20
+ allow(File).to receive(:open)
21
+ allow(File).to receive(:read).with('post_file_path')
22
+ allow(JSON).to receive(:parse) { { 'content' => '<strong>TEST</strong>' } }
23
+ @converter.convert_post_content('post_file_path')
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,64 @@
1
+ require 'spec_helper'
2
+ require './lib/wordpress/blog'
3
+ require './lib/wordpress/post'
4
+ require './lib/wordpress/post_attachment'
5
+ require './lib/wordpress/post_category_domain'
6
+ require './lib/wordpress/category'
7
+ require './lib/wordpress/tag'
8
+
9
+ module Contentful
10
+ module Exporter
11
+ module Wordpress
12
+ describe Blog do
13
+ include_context 'shared_configuration'
14
+
15
+ before do
16
+ xml_doc = Nokogiri::XML(File.open('spec/fixtures/wordpress.xml'))
17
+ @blog = Blog.new(xml_doc, @settings)
18
+ end
19
+
20
+ it 'initialize' do
21
+ expect(@blog.xml).to be_kind_of Nokogiri::XML::Document
22
+ expect(@blog.settings).to be_kind_of Contentful::Configuration
23
+ end
24
+
25
+ it 'blog_extractor' do
26
+ allow(Blog).to receive(:extract_blog)
27
+ end
28
+
29
+ it 'link_entry' do
30
+ entry = [{ test: 'remove', id: 'entry_id' }, { test: 'remove', id: 'entry_id_2' }]
31
+ link_entry = @blog.link_entry(entry)
32
+ expect(link_entry.count).to eq 2
33
+ expect(link_entry).to include(id: 'entry_id', type: 'Entry')
34
+ end
35
+
36
+ it 'link_asset' do
37
+ asset = { test: 'remove', id: 'asset_id' }
38
+ link_asset = @blog.link_asset(asset)
39
+ expect(link_asset.count).to eq 2
40
+ expect(link_asset).to include(id: 'asset_id', type: 'File')
41
+ end
42
+
43
+ it 'create_directory' do
44
+ allow(File).to receive(:directory?).and_return(true)
45
+ allow(File).to receive(:mkdir_p).with('/test/test.json').and_return(true)
46
+ @blog.create_directory('/test/test.json')
47
+ end
48
+
49
+ it 'valid blog entry' do
50
+ blog = JSON.parse(File.read('spec/fixtures/blog/entries/blog/blog_1.json'))
51
+ expect(blog.count).to eq 5
52
+ expect(blog['id']).to eq 'blog_id'
53
+ expect(blog['title']).to eq 'Moj blog 2'
54
+ expect(blog['posts'].count).to eq 7
55
+ expect(blog['posts'].first).to include('id' => 'post_1', 'type' => 'Entry')
56
+ expect(blog['categories'].count).to eq 4
57
+ expect(blog['categories'].first).to include('id' => 'category_14786', 'type' => 'Entry')
58
+ expect(blog['tags'].count).to eq 2
59
+ expect(blog['tags'].first).to include('id' => 'tag_2656354', 'type' => 'Entry')
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+ require './lib/wordpress/category'
3
+ require './lib/wordpress/blog'
4
+
5
+ module Contentful
6
+ module Exporter
7
+ module Wordpress
8
+ describe Category do
9
+ include_context 'shared_configuration'
10
+
11
+ before do
12
+ xml_doc = Nokogiri::XML(File.open('spec/fixtures/wordpress.xml'))
13
+ @category = Category.new(xml_doc, @settings)
14
+ end
15
+
16
+ it 'initialize' do
17
+ expect(@category.settings).to be_kind_of Contentful::Configuration
18
+ expect(@category.xml).to be_kind_of Nokogiri::XML::Document
19
+ end
20
+
21
+ it 'extract_categories' do
22
+ categories = @category.send(:extract_categories)
23
+ expect(categories).to be_kind_of Array
24
+ expect(categories.count).to eq 4
25
+ expect(categories.first).to include(id: 'category_14786', nicename: 'bez-kategorii', name: 'Bez kategorii')
26
+ expect(categories.last).to include(id: 'category_11599757', nicename: 'puchatka', name: 'puchatka')
27
+ end
28
+
29
+ it 'extracted_category' do
30
+ categories_xml = @category.xml.xpath('//wp:category').to_a
31
+ category = @category.send(:extracted_category, categories_xml.first)
32
+ expect(category).to be_kind_of Hash
33
+ expect(category.count).to eq 3
34
+ expect(category).to include(id: 'category_14786', nicename: 'bez-kategorii', name: 'Bez kategorii')
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+ require 'yaml'
3
+ require './lib/wordpress/export'
4
+
5
+ module Contentful
6
+ module Exporter
7
+ module Wordpress
8
+ describe Export do
9
+ include_context 'shared_configuration'
10
+
11
+ before do
12
+ @exporter = Export.new(@settings)
13
+ end
14
+
15
+ it 'initialize' do
16
+ expect(@exporter.settings).to be_kind_of Contentful::Configuration
17
+ expect(@exporter.wordpress_xml).to be_kind_of Nokogiri::XML::Document
18
+ end
19
+
20
+ it 'export_blog' do
21
+ @exporter.export_blog
22
+ expect(Dir.glob('spec/fixtures/blog/**/*').count).to eq 23
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ require './lib/wordpress/post_category_domain'
3
+ require './lib/wordpress/post'
4
+ require './lib/wordpress/blog'
5
+
6
+ module Contentful
7
+ module Exporter
8
+ module Wordpress
9
+ describe PostCategoryDomain do
10
+ include_context 'shared_configuration'
11
+
12
+ before do
13
+ xml_doc = Nokogiri::XML(File.open('spec/fixtures/wordpress.xml'))
14
+ post = xml_doc.xpath('//item').to_a[4]
15
+ @pc_domain = PostCategoryDomain.new(xml_doc, post, @settings)
16
+ end
17
+
18
+ it 'initialize' do
19
+ expect(@pc_domain.settings).to be_kind_of Contentful::Configuration
20
+ expect(@pc_domain.xml).to be_kind_of Nokogiri::XML::Document
21
+ end
22
+
23
+ it 'extract_tags' do
24
+ tags = @pc_domain.send(:extract_tags)
25
+ expect(tags).to be_kind_of Array
26
+ expect(tags.count).to eq 2
27
+ expect(tags.first).to include(id: 'tag_2656354')
28
+ expect(tags.last).to include(id: 'tag_306830130')
29
+ end
30
+
31
+ it 'extract_categories' do
32
+ categories = @pc_domain.send(:extract_categories)
33
+ expect(categories).to be_kind_of Array
34
+ expect(categories.count).to eq 3
35
+ expect(categories.first).to include(id: 'category_2214351')
36
+ expect(categories.last).to include(id: 'category_11599757')
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ require './lib/wordpress/post'
3
+ require './lib/wordpress/blog'
4
+ require './lib/wordpress/post_attachment'
5
+ require './lib/wordpress/post_category_domain'
6
+
7
+ module Contentful
8
+ module Exporter
9
+ module Wordpress
10
+ describe Post do
11
+ include_context 'shared_configuration'
12
+
13
+ before do
14
+ @xml_doc = Nokogiri::XML(File.open('spec/fixtures/wordpress.xml'))
15
+ @post = Post.new(@xml_doc, @settings)
16
+ end
17
+
18
+ it 'initialize' do
19
+ expect(@post.settings).to be_kind_of Contentful::Configuration
20
+ expect(@post.xml).to be_kind_of Nokogiri::XML::Document
21
+ end
22
+
23
+ it 'extract_data' do
24
+ post_xml = @xml_doc.xpath('//item').to_a.first
25
+ post = @post.send(:extract_data, post_xml)
26
+ expect(post.count).to eq 5
27
+ expect(post[:id]).to eq 'post_1'
28
+ expect(post[:title]).to eq 'Informacje'
29
+ expect(post[:wordpress_url]).to eq 'http://szpryc.wordpress.com/informacje/'
30
+ expect(post[:created_at]).to eq Date.parse('2014-11-26')
31
+ end
32
+
33
+ it 'post_id(post)' do
34
+ post = @xml_doc.xpath('//item').to_a.first
35
+ post_id = @post.post_id(post)
36
+ expect(post_id).to eq 'post_1'
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+ require './lib/wordpress/tag'
3
+ require './lib/wordpress/blog'
4
+
5
+ module Contentful
6
+ module Exporter
7
+ module Wordpress
8
+ describe Tag do
9
+ include_context 'shared_configuration'
10
+
11
+ before do
12
+ xml_doc = Nokogiri::XML(File.open('spec/fixtures/wordpress.xml'))
13
+ @tag = Tag.new(xml_doc, @settings)
14
+ end
15
+
16
+ it 'initialize' do
17
+ expect(@tag.settings).to be_kind_of Contentful::Configuration
18
+ expect(@tag.xml).to be_kind_of Nokogiri::XML::Document
19
+ end
20
+
21
+ it 'extract_tags' do
22
+ tags = @tag.send(:extract_tags)
23
+ expect(tags).to be_kind_of Array
24
+ expect(tags.count).to eq 2
25
+ expect(tags.first).to include(id: 'tag_2656354', nicename: 'testowy', name: 'testowy')
26
+ expect(tags.last).to include(id: 'tag_306830130', nicename: 'testowy2', name: 'testowy2')
27
+ end
28
+
29
+ it 'extracted_data' do
30
+ tags_xml = @tag.xml.xpath('//wp:tag').to_a
31
+ tag = @tag.send(:extracted_data, tags_xml.first)
32
+ expect(tag).to be_kind_of Hash
33
+ expect(tag.count).to eq 3
34
+ expect(tag).to include(id: 'tag_2656354', nicename: 'testowy', name: 'testowy')
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,13 @@
1
+ require 'simplecov'
2
+ SimpleCov.start 'rails'
3
+
4
+ require 'bundler/setup'
5
+ Bundler.setup
6
+
7
+ require 'rspec'
8
+ require 'rspec/its'
9
+ require 'yaml'
10
+ require 'json'
11
+ require 'nokogiri'
12
+
13
+ Dir[File.dirname(__FILE__) + '/support/*.rb'].each { |f| require f }
@@ -0,0 +1,5 @@
1
+ require 'multi_json'
2
+
3
+ def load_json(file, _as_json = false)
4
+ JSON.parse(File.read(File.dirname(__FILE__) + "/../fixtures/#{file}.json"))
5
+ end
@@ -0,0 +1,13 @@
1
+ require_relative '../../lib/configuration'
2
+
3
+ RSpec.shared_context 'shared_configuration', a: :b do
4
+ before do
5
+ yaml_text = <<-EOF
6
+ data_dir: spec/fixtures/blog
7
+ wordpress_xml_path: spec/fixtures/wordpress.xml
8
+ contentful_structure_dir: spec/fixtures//default_contentful_structure.json
9
+ EOF
10
+ yaml = YAML.load(yaml_text)
11
+ @settings = Contentful::Configuration.new(yaml)
12
+ end
13
+ end
@@ -0,0 +1,33 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require File.expand_path('../lib/version', __FILE__)
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'wordpress-exporter'
8
+ spec.version = Version::VERSION
9
+ spec.authors = ['Contentful GmbH (Andreas Tiefenthaler)']
10
+ spec.email = ['rubygems@contentful.com']
11
+ spec.description = 'WordPress exporter that prepares content to be imported'
12
+ spec.summary = 'Exporter for WordPress based blogs'
13
+ spec.homepage = 'https://github.com/contentful/wordpress-exporter.rb'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables << 'wordpress-exporter'
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'http', '~> 0.6'
22
+ spec.add_dependency 'multi_json', '~> 1'
23
+ spec.add_dependency 'activesupport', '~> 4.1'
24
+ spec.add_dependency 'escort', '~> 0.4.0'
25
+ spec.add_dependency 'i18n', '~> 0.6'
26
+ spec.add_dependency 'nokogiri', '~> 1.6.3.1'
27
+ spec.add_dependency 'reverse_markdown', '~> 0.6.0'
28
+
29
+ spec.add_development_dependency 'rspec', '~> 3'
30
+ spec.add_development_dependency 'rspec-its', '~> 1.1.0'
31
+ spec.add_development_dependency 'bundler', '~> 1.6'
32
+ spec.add_development_dependency 'rake'
33
+ end
@@ -0,0 +1,288 @@
1
+ {
2
+ "sys": {
3
+ "type": "Array"
4
+ },
5
+ "total": 4,
6
+ "skip": 0,
7
+ "limit": 100,
8
+ "items": [
9
+ {
10
+ "fields": [
11
+ {
12
+ "name": "posts",
13
+ "id": "posts",
14
+ "type": "Array",
15
+ "items": {
16
+ "type": "Link",
17
+ "linkType": "Entry"
18
+ }
19
+ },
20
+ {
21
+ "name": "title",
22
+ "id": "title",
23
+ "type": "Text",
24
+ "localized": true
25
+ },
26
+ {
27
+ "name": "categories",
28
+ "id": "categories",
29
+ "type": "Array",
30
+ "items": {
31
+ "type": "Link",
32
+ "linkType": "Entry"
33
+ }
34
+ },
35
+ {
36
+ "name": "tags",
37
+ "id": "tags",
38
+ "type": "Array",
39
+ "items": {
40
+ "type": "Link",
41
+ "linkType": "Entry"
42
+ }
43
+ }
44
+ ],
45
+ "name": "Blog",
46
+ "sys": {
47
+ "id": "3gldgGyAyci8ak0cykKeou",
48
+ "type": "ContentType",
49
+ "createdAt": "2014-11-26T13:49:24.203Z",
50
+ "createdBy": {
51
+ "sys": {
52
+ "type": "Link",
53
+ "linkType": "User",
54
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
55
+ }
56
+ },
57
+ "space": {
58
+ "sys": {
59
+ "type": "Link",
60
+ "linkType": "Space",
61
+ "id": "1j2osuxmfs25"
62
+ }
63
+ },
64
+ "firstPublishedAt": "2014-11-26T13:49:45.142Z",
65
+ "publishedCounter": 4,
66
+ "publishedAt": "2014-12-01T09:59:19.695Z",
67
+ "publishedBy": {
68
+ "sys": {
69
+ "type": "Link",
70
+ "linkType": "User",
71
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
72
+ }
73
+ },
74
+ "publishedVersion": 46,
75
+ "version": 47,
76
+ "updatedAt": "2014-12-01T09:59:19.743Z",
77
+ "updatedBy": {
78
+ "sys": {
79
+ "type": "Link",
80
+ "linkType": "User",
81
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
82
+ }
83
+ }
84
+ },
85
+ "displayField": "title"
86
+ },
87
+ {
88
+ "fields": [
89
+ {
90
+ "name": "nicename",
91
+ "id": "nicename",
92
+ "type": "Text"
93
+ },
94
+ {
95
+ "name": "name",
96
+ "id": "name",
97
+ "type": "Text"
98
+ }
99
+ ],
100
+ "name": "Tag",
101
+ "sys": {
102
+ "id": "wO1krKenNQcWMSqaeysWo",
103
+ "type": "ContentType",
104
+ "createdAt": "2014-12-01T09:25:56.175Z",
105
+ "createdBy": {
106
+ "sys": {
107
+ "type": "Link",
108
+ "linkType": "User",
109
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
110
+ }
111
+ },
112
+ "space": {
113
+ "sys": {
114
+ "type": "Link",
115
+ "linkType": "Space",
116
+ "id": "1j2osuxmfs25"
117
+ }
118
+ },
119
+ "firstPublishedAt": "2014-12-01T09:26:45.362Z",
120
+ "publishedCounter": 2,
121
+ "publishedAt": "2014-12-01T09:27:45.169Z",
122
+ "publishedBy": {
123
+ "sys": {
124
+ "type": "Link",
125
+ "linkType": "User",
126
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
127
+ }
128
+ },
129
+ "publishedVersion": 44,
130
+ "version": 45,
131
+ "updatedAt": "2014-12-01T09:27:45.216Z",
132
+ "updatedBy": {
133
+ "sys": {
134
+ "type": "Link",
135
+ "linkType": "User",
136
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
137
+ }
138
+ }
139
+ },
140
+ "description": null,
141
+ "displayField": "nicename"
142
+ },
143
+ {
144
+ "fields": [
145
+ {
146
+ "name": "nicename",
147
+ "id": "nicename",
148
+ "type": "Text"
149
+ },
150
+ {
151
+ "name": "name",
152
+ "id": "name",
153
+ "type": "Text"
154
+ }
155
+ ],
156
+ "name": "Category",
157
+ "sys": {
158
+ "id": "5PIooPqWmAcYyQ04c2KUcQ",
159
+ "type": "ContentType",
160
+ "createdAt": "2014-12-01T09:26:50.679Z",
161
+ "createdBy": {
162
+ "sys": {
163
+ "type": "Link",
164
+ "linkType": "User",
165
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
166
+ }
167
+ },
168
+ "space": {
169
+ "sys": {
170
+ "type": "Link",
171
+ "linkType": "Space",
172
+ "id": "1j2osuxmfs25"
173
+ }
174
+ },
175
+ "firstPublishedAt": "2014-12-01T09:27:16.440Z",
176
+ "publishedCounter": 3,
177
+ "publishedAt": "2014-12-01T10:44:56.239Z",
178
+ "publishedBy": {
179
+ "sys": {
180
+ "type": "Link",
181
+ "linkType": "User",
182
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
183
+ }
184
+ },
185
+ "publishedVersion": 31,
186
+ "version": 32,
187
+ "updatedAt": "2014-12-01T10:44:56.283Z",
188
+ "updatedBy": {
189
+ "sys": {
190
+ "type": "Link",
191
+ "linkType": "User",
192
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
193
+ }
194
+ }
195
+ },
196
+ "displayField": "name"
197
+ },
198
+ {
199
+ "fields": [
200
+ {
201
+ "name": "title",
202
+ "id": "title",
203
+ "type": "Text"
204
+ },
205
+ {
206
+ "name": "content",
207
+ "id": "content",
208
+ "type": "Text"
209
+ },
210
+ {
211
+ "name": "tags",
212
+ "id": "tags",
213
+ "type": "Array",
214
+ "items": {
215
+ "type": "Link",
216
+ "linkType": "Entry"
217
+ }
218
+ },
219
+ {
220
+ "name": "categories",
221
+ "id": "categories",
222
+ "type": "Array",
223
+ "items": {
224
+ "type": "Link",
225
+ "linkType": "Entry"
226
+ }
227
+ },
228
+ {
229
+ "name": "wordpress_url",
230
+ "id": "wordpress_url",
231
+ "type": "Text"
232
+ },
233
+ {
234
+ "name": "attachment",
235
+ "id": "attachment",
236
+ "type": "Link",
237
+ "linkType": "Asset"
238
+ },
239
+ {
240
+ "name": "created_at",
241
+ "id": "created_at",
242
+ "type": "Date"
243
+ }
244
+ ],
245
+ "name": "Post",
246
+ "sys": {
247
+ "id": "KHqITFZXeCIokyOEc4k0k",
248
+ "type": "ContentType",
249
+ "createdAt": "2014-11-26T13:15:08.574Z",
250
+ "createdBy": {
251
+ "sys": {
252
+ "type": "Link",
253
+ "linkType": "User",
254
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
255
+ }
256
+ },
257
+ "space": {
258
+ "sys": {
259
+ "type": "Link",
260
+ "linkType": "Space",
261
+ "id": "1j2osuxmfs25"
262
+ }
263
+ },
264
+ "firstPublishedAt": "2014-11-26T13:16:17.537Z",
265
+ "publishedCounter": 6,
266
+ "publishedAt": "2015-01-07T10:25:09.043Z",
267
+ "publishedBy": {
268
+ "sys": {
269
+ "type": "Link",
270
+ "linkType": "User",
271
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
272
+ }
273
+ },
274
+ "publishedVersion": 92,
275
+ "version": 93,
276
+ "updatedAt": "2015-01-07T10:25:09.102Z",
277
+ "updatedBy": {
278
+ "sys": {
279
+ "type": "Link",
280
+ "linkType": "User",
281
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
282
+ }
283
+ }
284
+ },
285
+ "displayField": "title"
286
+ }
287
+ ]
288
+ }