GithubHelp home page GithubHelp logo

limoon's Introduction

limoon-logo

PyPI - Version PyPI - Python Version GitHub License GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status

Limoon (limon-moon, limon is lemon but Turkish), web scraper base Pythonic API for Ekşi Sözlük. This module can get topics, entries and authors. It also has debe and gündem page support. Contributions are most welcome!

Installing

pip install -U limoon

Examples

import limoon


topic = limoon.get_topic("richard stallman")
# Topic(43270)
list(topic.entrys)
# [Entry(1091215), Entry(1091227), Entry(2137487), ...]
dir(topic)
# [..., 'entrys', 'id', 'page_count', 'path', 'title', 'url']

entry = limoon.get_entry(2878417)
# Entry(2878417)
entry.content
# "programcılıgın 8. harikası"
dir(entry)
# [..., 'author_nickname', 'content', 'created', 'edited', 'favorite_count', 'id', 'url']

author = limoon.get_author("ssg")
# Author(ssg)
dir(author)
# [..., 'avatar_url', 'badges', 'biography', 'follower_count', 'following_count', 'nickname', 'rank', 'total_entry', 'url']

Documentation

Documentation is here. This page is auto generated. Don't edit!

License

limoon is distributed under the terms of the MIT license. Also the logo was made by @beucismis.

limoon's People

Contributors

beucismis avatar

Stargazers

Anne Thorpe avatar Tufan Koç avatar CePur avatar Anıl Özbek avatar  avatar Can' avatar Sezer Bozkır avatar

Watchers

Anıl Özbek avatar  avatar

Forkers

natgho

limoon's Issues

Başlıktaki tüm girdilerin çekimi

https://eksisozluk.com/1-evlenmeyin-2-evlenmeyin-3-evlenmeyin--6870058 başlığında geçen bir iddia vardı, başlığa en çok girişin pazar günleri yapıldığına dair.

Bunun doğruluğunu görmek için basit bir araştırma yapmak istedim. Bunun için de ilk başta tüm girdilerin tarih bilgisini çekmek gerekiyor. Bu da en kolay API yardımıyla olacağı için GitHub'da güncel bir şeyler bakınırken sizin projenize ve selenium-eksisozluk'e denk geldim.

Oldukça temiz, kolay ve ayrıca belgelendirilmiş bir kullanımı olduğu için limoon ile başladım ama bir başlıktaki sadece 10 girdi çekiliyor.

import limoon

topic = limoon.get_topic("1-evlenmeyin 2-evlenmeyin 3-evlenmeyin")

for x in topic.entrys:
  print(x.created)
30.03.2021 09:52
30.03.2021 09:53
30.03.2021 09:53
30.03.2021 09:54
30.03.2021 09:54
30.03.2021 09:55
30.03.2021 09:56
30.03.2021 09:58
30.03.2021 09:58
30.03.2021 09:59

Başlıktaki tüm girdileri doğrudan çekmek veya başlığın kaç sayfa olduğu bilgisine yönelik de bir fonksiyon sunarak kullanıcının tüm bu sayfalardan kendi oluşturacağı bir döngüyle çekim yapabilmesini sağlamak çok işe yarar olacaktır.

Proje için teşekkürler. Şimdilik kod desteği veremiyorum. İyi çalışmalar.

Sonradan gelen not: Aşağıdaki gibi bir kullanım mümkünmüş, kaydı geçersiz olarak kapatabilirsiniz veya yine de tek seferde girdilerin çekilmesi için kaydı açık bırakabilirsiniz ya da belgelendirmeye böyle bir kullanım olabileceği bilgisini ekleyebilirsiniz.

import limoon

topic = limoon.get_topic("1-evlenmeyin-2-evlenmeyin-3-evlenmeyin--6870058")

for x in range(1, topic.page_count + 1):
  topic = limoon.get_topic("1-evlenmeyin-2-evlenmeyin-3-evlenmeyin--6870058?p=" + str(x))
  for y in topic.entrys:
    print(y.created)

Daha sonradan gelen not: Merak edebilecekler ve benim gibi sürekli Python kullanmayanlara örnek olması için:

import limoon
import datetime

from collections import Counter

topic = limoon.get_topic("1-evlenmeyin-2-evlenmeyin-3-evlenmeyin--6870058")

gunler = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

gun_sayilari = Counter()

for x in range(1, topic.page_count + 1):
  topic = limoon.get_topic("1-evlenmeyin-2-evlenmeyin-3-evlenmeyin--6870058?p=" + str(x))
  for y in topic.entrys:
    dt = y.created
    dt = dt[0:10]
    day, month, year = (int(x) for x in dt.split('.'))
    ans = datetime.date(year, month, day)
    gun_sayilari[ans.strftime("%A")] += 1

for gun in gunler:
  print(f"{gun}: {gun_sayilari[gun]}")
Monday: 637
Tuesday: 625
Wednesday: 364
Thursday: 352
Friday: 345
Saturday: 933
Sunday: 1126

Yazar rozet ve seçilmiş rozetleri

Merhaba,

Aklımdaki birkaç kaydı daha ara ara gireceğim. Projede yer almasının iyi olacağını düşündükleriniz kalabilir, diğerlerini kapatabilirsiniz. Açık kalanları da, siz, diğer katkıcılar veya ben zamanla gerçekleştiririz.

https://eksisozluk.com/rozetler/kullanıcı_adı sayfasında badge-icons-container div'i altındaki selected-badge-item ve data-owned bunun için kullanılabilir sanırım.

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.