Coder Social home page Coder Social logo

sanduhrs / bridgy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snarfed/bridgy

0.0 2.0 0.0 7.61 MB

Got a web site? Want to publish your posts to social networks? Want to see comments and likes on your site? Bridgy is for you.

Home Page: http://brid.gy/

Python 98.16% JavaScript 0.65% CSS 1.19%

bridgy's Introduction

Got a web site? Want to publish your posts to social networks? Want to see comments, likes, and more on your site? Bridgy copies them back for you.

http://brid.gy/

See the docs for more details.

License: This project is placed in the public domain.

Development

Most dependencies are in git submodules. Be sure to run git submodule update --init --recursive after you clone the repo.

Requires the App Engine SDK and looks for it in the GAE_SDK_ROOT environment variable, /usr/local/google_appengine, or ~/google_appengine, in that order.

You can run the unit tests with alltests.py. If you send a pull request, please include (or update) a test for the new functionality if possible!

This command runs the tests, pushes any changes in your local repo(s), and deploys to App Engine:

./alltests.py && cd activitystreams && ./alltests.py && \
  cd oauth_dropins && ./alltests.py && cd webutil && ./alltests.py && \
  cd ../../.. && git push --recurse-submodules=on-demand && \
  ~/google_appengine/appcfg.py --oauth2 update .

Most dependencies are clean, but we've made patches to some that we haven't (yet) tried to push upstream. If we ever switch submodule repos for those dependencies, make sure the patches are included!

  • snarfed/gdata-python-client@fabb6227361612ac4fcb8bef4438719cb00eaa2b
  • snarfed/gdata-python-client@8453e3388d152ac650e22d219fae36da56d9a85d

Misc

The datastore is automatically backed up by a cron job that runs Datastore Admin backup and stores the results in Cloud Storage, in the brid-gy.appspot.com bucket. It backs up all entities weekly, and all entities except Response and SyndicatedPost daily, since they make up 92% of all entities by size and they aren't as critical to keep.

We use this command to set a Cloud Storage lifecycle policy on that bucket that deletes all files over 30 days old:

gsutil lifecycle set cloud_storage_lifecycle.json gs://brid-gy.appspot.com

So far, this has kept us within the 5GB free quota. Run this command to see how much space we're currently using:

gsutil du -hsc gs://brid-gy.appspot.com/\*

Here are remote_api_shell and shell commands for generating the statistics published at brid.gy/about#stats:

# remote_api_shell
from models import Response
cursor = None
with open('sent_urls', 'w') as sent, open('unsent_urls', 'w') as unsent:
  while True:
    results, cursor, _ = Response.query(
#      projection=[Response.sent,Response.skipped,Response.error,Response.failed]
      ).fetch_page(100, start_cursor=cursor)
    if not results:
      break
    for r in results:
      print >> sent, '\n'.join(r.sent)
      print >> unsent, '\n'.join(r.skipped + r.error + r.failed)

# shell
sort sent_urls  | uniq > sent_uniq
cut -f3 -d/ sent_uniq | sed 's/^www\.//' | sort --ignore-case | uniq -i > sent_domains
wc sent_urls sent_uniq sent_domains

Related projects and docs

bridgy's People

Contributors

snarfed avatar kylewm avatar

Watchers

Stefan Auditor avatar James Cloos 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.