Giter Club home page Giter Club logo

wordpressarticleextractor's Introduction

WordPress Article Extractor

Description

WordPress Article Extractor is a Python script designed to extract articles from a MySQL database, particularly from a WordPress installation. It saves each article in plain text format to individual text files, which can be useful for tasks such as content analysis, data migration, or archiving blog posts.

Features

  • Connects to a MySQL database to retrieve articles stored in the wp_posts table.
  • Extracts articles with the post type 'post' and status 'publish'.
  • Converts HTML content of articles to plain text using BeautifulSoup.
  • Saves each article as a separate text file named with the format article_{post_id}.txt.

Requirements

Installation

  1. Install Python 3.x from python.org.
  2. Install MySQL Connector/Python and BeautifulSoup4 using pip:
    pip install mysql-connector-python beautifulsoup4

Usage

  1. Run the script:

    python SQL_POST_EXT.py
  2. Enter your MySQL User when prompted.

    Screenshot from 2024-04-15 00-49-11

  3. Enter your MySQL Password when prompted.

    Screenshot from 2024-04-15 00-49-42

  4. Enter your MySQL Database_Name when prompted.

    Screenshot from 2024-04-15 00-49-58

  5. The script will extract articles from the database and save each article as a separate text file in the current directory.

    Screenshot from 2024-04-15 00-50-38

License

This project is licensed under the MIT License. See the LICENSE file for details.

wordpressarticleextractor's People

Contributors

offseckalki avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.