-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.rb
30 lines (22 loc) · 1004 Bytes
/
init.rb
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
EXPORT_ACCESS_TOKEN = "YOUR ACCESS TOKEN"
IMPORT_ACCESS_TOKEN = "YOUR ACCESS TOKEN"
COLLECTION_NAME = "YOUR COLLECTION NAME"
AUTHOR_ID = "YOUR ADMIN ID"
#If you need to change URLS within your Articles that point to your old Helpcenter, fill in these fields. Otherwise, leave blank.
REPLACE_ARTICLE_URLS = true
EXPORT_CUSTOM_DOMAIN = "YOUR CUSTOM DOMAIN HERE"
IMPORT_CUSTOM_DOMAIN = "NEW CUSTOM DOMAIN HERE"
#commandthatexports-importsarticles
#List all articles that need to be published
#if needs to be copied -- create an ArticleIndex object. This will contain both the import_id AND the export_id
require 'intercom'
require 'nokogiri'
require 'mutations'
require 'pry'
require './fix_redirects.rb'
require './article.rb'
require './article_collection.rb'
require './article_importer.rb'
ExportWorkspace = Intercom::Client.new(token: EXPORT_ACCESS_TOKEN)
ImportWorkspace = Intercom::Client.new(token: IMPORT_ACCESS_TOKEN)
Collection = ImportWorkspace.collections.create(name: COLLECTION_NAME)