Verified Commit ec8de74b authored by Agate's avatar Agate 💬

Tmp wrapper scripts to fetch data from gitlab / opencollective

parent a75a79dc
from contributions.sources import opencollective
def retrieve_transactions(collective_id):
per_page = 50
offset = 0
while True:
transactions = opencollective.retrieve_transactions(
collective_id, limit=per_page, offset=offset
)
for t in transactions:
yield t
if len(transaction) < per_page: # last page
break
collective_id = 18778
collective_slug = "funkwhale"
for i, transaction in enumerate(retrieve_transactions(collective_id)):
print(
"Importing contribution in database",
transaction["id"],
transaction["description"],
)
opencollective.import_transaction_as_contribution(transaction, collective_slug)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment