Ning import script

I have some questions about configuring ning.rb.

My Ning export looks like this:

  • What exactly are ATTACHMENT_PREFIXES? The default value is: ["discussions", "pages", "blogs", "members", "photos"]. These look like they should map to the exported folders. Should I add events and members to this list, as they are missing?

  • I assume that I should put all filetypes that I want imported in EXTRA_AUTHORIZED_EXTENSIONS. Are these values case insensitive? (I look into the existing files and some extensions are in all caps for some reason.)

I have taken a stab at configuring the JSON import as follows:

Initialize

@users_json       = load_ning_json("ning-members-local.json")
@discussions_json = load_ning_json("ning-discussions-local.json")

# An example of a custom category from Ning:
@blogs_json       = load_ning_json("ning-blogs-local.json")

# My additions
@events_json      = load_ning_json("ning-events-local.json")
@groups_json      = load_ning_json("ning-groups-local.json")
@moreusers_json   = load_ning_json("ning-members.json")
@pages_json       = load_ning_json("ning-pages-local.json")
@photos_json      = load_ning_json("ning-photos-local.json")

Import

import_users
import_categories
import_discussions

import_blogs # Remove this and/or add more as necessary

# My additions
import_events
import_groups
import_moreusers
import_pages
import_photos
  • How do I create functions to import all of these? Is it sufficient to do something like this:
def import_XYZ
  puts "", "Importing XYZ"
  import_topics(@XYZ_json, "XYZ")
end

(Where XYZ one of events, groups, pages, etc.)

Finally, for reasons that are unclear to me, I have two member files: ning-members-local.json and ning-members.json.

  • Is it better to combine these at the JSON level or duplicate the users stuff twice?

Any help would be much appreciated :slightly_smiling: