Skip to content

Instantly share code, notes, and snippets.

@desmondmorris
Created December 26, 2013 21:40
Show Gist options
  • Save desmondmorris/8139060 to your computer and use it in GitHub Desktop.
Save desmondmorris/8139060 to your computer and use it in GitHub Desktop.
Drupal export for tumblr
SELECT
'text' as type,
'published' as state,
'off' as tweet,
FROM_UNIXTIME(n.created) as 'date',
'html' as format,
REPLACE(a.alias, 'blog/','') as slug,
n.title,
b.body_value as body
FROM node n
LEFT JOIN url_alias a ON a.source = concat('node/', n.nid)
LEFT JOIN field_data_body b ON b.entity_id = n.nid
WHERE n.type ='news_article'
AND n.status = 1
AND bundle = n.type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment