• 19-05-2024, 16:17:09
    #1
    Merhaba,DLE web sitemizi wordpress'e geçirmek istiyoruz, bunun için bir eklenti veya yazılım var mı?
  • 19-05-2024, 16:18:19
    #2
    https://github.com/wp-plugins/cms2cm...o-wp-convertor

    şöyle bir şey buldum hocam bakabilirsin bi
  • 19-05-2024, 16:20:55
    #3
    VektorMedya adlı üyeden alıntı: mesajı görüntüle
    https://github.com/wp-plugins/cms2cm...o-wp-convertor

    şöyle bir şey buldum hocam bakabilirsin bi
    teşekkürler ama 10 sene önce yazılmış hocam bu, daha stabil bir şey bulamadım
  • 19-05-2024, 16:22:24
    #4
    anilguler adlı üyeden alıntı: mesajı görüntüle
    teşekkürler ama 10 sene önce yazılmış hocam bu, daha stabil bir şey bulamadım
    pardon hocam bakmadım tarihe
  • 19-05-2024, 16:23:45
    #5
    VektorMedya adlı üyeden alıntı: mesajı görüntüle
    pardon hocam bakmadım tarihe
    Estağfirullah hocam teşekkürler yine de sağolun
  • 19-05-2024, 16:28:39
    #6
    hocam python ile özel bir bot yazdırılır. bütün veriler çekilir ve wordpress api ile yüklenebilir başak çözümü yoktur.
  • 19-05-2024, 16:32:49
    #7
    import pymysql
    import requests
    from requests.auth import HTTPBasicAuth
    
    # DLE veritabanı bilgileri
    dle_db_host = 'localhost'
    dle_db_user = 'dle_db_user'
    dle_db_password = 'dle_db_password'
    dle_db_name = 'dle_db_name'
    
    # WordPress API bilgileri
    wp_site_url = 'https://yourwordpresssite.com'
    wp_api_endpoint = '/wp-json/wp/v2/posts'
    wp_username = 'your_wp_username'
    wp_password = 'your_wp_password'
    
    # DLE veritabanına bağlanma
    connection = pymysql.connect(
        host=dle_db_host,
        user=dle_db_user,
        password=dle_db_password,
        database=dle_db_name
    )
    
    def get_dle_content():
        with connection.cursor() as cursor:
            sql = "SELECT id, title, short_story, full_story, category, tags FROM dle_post"
            cursor.execute(sql)
            result = cursor.fetchall()
        return result
    
    def create_wp_post(title, content, categories, tags):
        url = wp_site_url + wp_api_endpoint
        data = {
            'title': title,
            'content': content,
            'status': 'publish',
            'categories': categories,
            'tags': tags
        }
        response = requests.post(url, json=data, auth=HTTPBasicAuth(wp_username, wp_password))
        return response
    
    def main():
        dle_contents = get_dle_content()
        for content in dle_contents:
            title = content[1]
            short_story = content[2]
            full_story = content[3]
            category = [int(cat) for cat in content[4].split(',')]
            tags = content[5].split(',')
    
            # WordPress gönderisi oluşturma
            response = create_wp_post(title, full_story, category, tags)
            if response.status_code == 201:
                print(f"Başarıyla oluşturuldu: {title}")
            else:
                print(f"Hata: {response.status_code} - {response.text}")
    
    if __name__ == "__main__":
        main()