bookieio / bookie Goto Github PK
View Code? Open in Web Editor NEWPython based delicious.com replacement
License: GNU Affero General Public License v3.0
Python based delicious.com replacement
License: GNU Affero General Public License v3.0
What it says now:
Use the Import Bookmarks tool to import your bookmarks from Delicious or Google Bookmarks.
You will need an html export file from either of these services.
What it could say:
Import your bookmarks from any of the supported services (listed below).
"Import File" is the html-version of your export from one of the supported services.
"API Key" is the secret key specific to this Bookie installation. If you don't know what this is, please contact your Bookie host provider.
- If you are the host provider, this setting is in the .ini file associated with this installation (usually found in the Bookie/ directory).
We should be running and checking the qunit tests we have in the system. Currently we only have them for the JS used in the extensions code.
!private
!email
!nocontent
!mobile
Are sample commands we might want to tell the system when we bookmark a url. The completion system should help complete !X tags and we should process some action for those on the server side when saving the urls.
OperationalError: (OperationalError) (1170, "BLOB/TEXT column 'url' used in key specification without a key length") '\nCREATE TABLE url_hash (\n\thash_id VARCHAR(22) NOT NULL, \n\turl TEXT, \n\tclicks INTEGER, \n\tPRIMARY KEY (hash_id), \n\tUNIQUE (url)\n)\n\n' ()
MySQL can't have a unique index on a TEXT() field. It needs a length limit. So have to either use varchar for the key, or perhaps to just drop the unique constraint for mysql use. Not sure yet.
When we catch an error, be it a failed code value of a 200 request, or an http error code, create a JS object that we use to set the badgeText to that error code. This should help debugging for things like "your api key doesn't match" to "you had invalid tags" or something.
Need to document that these two libs are required to install python package lxml.
This might be an advantage for readability since it's pure python, but it's slower and doesn't seem to be kept as up to date, so hate to use that ootb.
http://www.scribd.com/doc/30715288/The-Open-Graph-Protocol-Design-Decisions
Traceback (most recent call last):
File "scripts/readability/existing.py", line 70, in
read = ReadUrl.parse(hashed.url)
File "/home/rharding/src/bookie/Bookie/Bookie/bookie/lib/readable.py", line 142, in parse
read.set_content(Document(fh.read()).summary())
File "/usr/lib/python2.6/socket.py", line 329, in read
data = self._sock.recv(rbufsize)
File "/usr/lib/python2.6/httplib.py", line 518, in read
return self._read_chunked(amt)
File "/usr/lib/python2.6/httplib.py", line 561, in _read_chunked
raise IncompleteRead(''.join(value))
httplib.IncompleteRead: IncompleteRead(7365 bytes read)
So for example, running the existing.py through my bookmark collection gives me:
status_code | count
-------------+-------
200 | 1342
404 | 142
901 | 30
403 | 26
302 | 8
410 | 4
503 | 3
905 | 2
500 | 2
401 | 1
1 | 1
There should be a web view for me to see which of these urls were 404, determine if I want to remove/clean them, etc.
Just for the record:
1 = manually parsed from the chrome extension
900+ error codes are issues with urllib or decruft parsing.
Get the packages locally and set them up behind nginx with indexes on, then setup the tests to call that vs out to pypi, should speed up hudson tests a bunch.
Need to make sure we lock the versions down on the requirements.txt and setup.py, use pip freeze to check/set those for packages missing the version numbers.
Debating back/forth on if this is a 0.1 thing or not
Setup an install management script that can use the migrate api to check for db, check version, handle upgrades, etc. Would also need to know/determine what .ini file we're using and determining how to set it up/tell it what .ini file to use.
Need to pull _is_authed from views/bmarks.py and put it into access.py, along with the api_key_check.
Need to flesh out the web ui. Consistent ui elements for buttons and controls is important part of it.
Track clicks and display more frequently used
Show most recently added
Add a checkbox for "mobile" and display those first
Make sure search is up top/easy to get to. Maybe hidden div wtih "Search" button in header
When you update a bookmark with sqlite, the fulltext tables need to be updated with the new tag and such on both insert and update.
Would like to have a nice autocomplete ui on the main page for filtering bookmarks by tags. Allow more than one like the delicious main page does.
Look at using the same thing as the google chrome extension when it gets completion for tags.
Need to be able to grab the page content for readability storage (using the python readability parser) to store it. Also need the corresponding script to do it for all existing urls.
Should have some smarts, don't replace old content with blank content, etc.
First get it stored, just as a 'backup' and then we can look at how to expose it out to the user. Might see if the extension can grab the html and send it in post for new bookmarks to help avoid an extra request.
We'll need a test directory for JS that runs the main html site vs the extension. Then the BookieJS build needs to be updated to also run the phantomjs test runner on that as well as the one it currently does for extensions.
Definitely need one of these, have to figure out best license and such.
Right now we work with all three dbs ootb: sqlite, mysql, postgresql. However, this means we need to the -dev header packages for both mysqlclient and psotgresql-server.
What we should be doing, is to move the db install step to the fab command that sets up the database server, db_new_install. It can then check the right db driver to install based on the current selected sqlalchemy.url setting in the .ini file.
If a user wants to change it, to go from sqlite to postgresql, etc we can deal with that then and supply some docs. This should make install easier/smoother.
On the firefox extension: when the toolbarbutton is clicked, the Tags textbox is given focus. If you try to click in the Description textbox, the Tags textbox keeps focus. Really annoying.
So that you can just start typing tags and save away
Need to make sure we trim the spaces from the end of strings and check for a tag of just " " when storing.
We need to generate it like we do the .ini file on install using the fab new_install command.
Might be cool to have a qrcode available to generate so you could nab a url from someone's bookie install on your mobile device:
(not sure what the right terminology is for password-like text entry forms)
Why? Because the API Key might be some weird combination of letters, numbers, and symbols set by a Bookie administrator and the user might be trying to type it in character by character.
Also, since it is not a password it shouldn't look like one. :)
We should add a nice footer with some small text for things like version info, links to bookie's website, tickets maybe, and I'd move the import link down there since it's less frequently used.
File "_utils_export_mako", line 33, in render_body
AttributeError: 'Bmark' object has no attribute 'url'
I want to update for cleaner urls:
/filter/tag1/tag2
/search/term1/term2
/search/term1/term2?with_content=true
In the Firefox extension, if a user opens the Bookie popup while at a bookmarked URL, the Delete button will enable. If the user then leaves the page, heading to a URL that's not currently bookmarked, the Delete button stays enabled. It should disable.
When deleting a bookmark, it throws the following error:
URL: http://127.0.0.1:6543/bmark/delete
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/WebError-0.10.3-py2.6.egg/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/repoze.tm2-1.0b1-py2.6.egg/repoze/tm/init.py', line 44 in call
self.commit()
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/repoze.tm2-1.0b1-py2.6.egg/repoze/tm/init.py', line 52 in commit
t.commit()
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/transaction-1.1.1-py2.6.egg/transaction/_transaction.py', line 329 in commit
self._commitResources()
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/transaction-1.1.1-py2.6.egg/transaction/_transaction.py', line 441 in _commitResources
rm.tpc_begin(self)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/zope.sqlalchemy-0.6.1-py2.6.egg/zope/sqlalchemy/datamanager.py', line 87 in tpc_begin
self.session.flush()
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/session.py', line 1388 in flush
self._flush(objects)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/session.py', line 1469 in _flush
flush_context.execute()
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/unitofwork.py', line 302 in execute
rec.execute(self)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/unitofwork.py', line 402 in execute
self.dependency_processor.process_deletes(uow, states)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/dependency.py', line 488 in process_deletes
uowcommit, False)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/dependency.py', line 532 in _synchronize
sync.clear(dest, self.mapper, self.prop.synchronize_pairs)
File '/home/craig/.virtualenvs/bookie/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/sync.py', line 41 in clear
(r, mapperutil.state_str(dest))
AssertionError: Dependency rule tried to blank-out primary key column 'readable.hash_id' on instance '<Readable at 0x2bd3390>'
I bookmarked this page: http://pockey.dao2.com/2011/04/bangalore-hackfest-day-4-5/
When I go to load it back up, it fails and I cannot delete. It appears that the xml response isn't parseable by jquery's
$(xml).find('posts')
The $(xml) comes back as null.
Test XML for building a test case
<?xml version="1.0" encoding="UTF-8"?>
<posts user="none" dt="2011-04-02" tag="">
<post href="http://pockey.dao2.com/2011/04/bangalore-hackfest-day-4-5"
hash="---"
description="Bangalore Hackfest – Day 4 & 5 » Inspiration is food for every soul!"
extended=""
tag="gnome" time="2011-04-02 14:10:52.783012"
others="--"></post>
</posts>
The set of results from when I search without "Content" checked should be a subset of when I have "Content" checked.
Right now, I get two results when "Content" is not checked, but zero results when it is. That is unexpected :)
There's a note we need to escape. The url params coming in should be good, but dbl check what mako rendering the xml response back is going to do with some items.
Desire is to right-click "Save as bookmark" to quickly store a url. Tags used would be set in the options.html as the 'content tags' or something.
See: http://code.google.com/chrome/extensions/contextMenus.html
Federation is a honkin' great idea. Let's do more of that.
Needs to at least support
Nice to haves
... or similar. At least have /export be a page not just a function call that returns the html.
Why, because sometimes people just click on those import/export links at the bottom without actually wanting to do the action, just curious what it is.
Also, because theoretically the /export function could take a while with large databases.
Also, because it will give us a way to tell the browswer "this is a file the user wants to download, not display as a webpage" (maybe zip the html like diigo does to force that?). If it is displayed as a webpage, some users might not know what to do from there.
Proposed text:
This will create an export/backup of all your bookmarks currently in Bookie. With this file, you can import your bookmarks into your browser or other web-based bookmarking services (such as Diigo, Delicious, or pinboard.in) or just save it for safe keeping (backups are always good!).
[EXPORT BUTTON]
Need to test and figure out how to handle bookmark tags with spaces. How do we allow it from the api, how do we handle on import, and how to handle pulling it correctly on searches.
Especially since things like adding fulltext requires you to reimport your bookmarks. Need an exportor to send them out, and then we can reimport them after an app upgrade.
If we don't have that we need an upgrade script, end of the day we probably need both, but will want an exporter so users feel like they can escape anyway.
Will need to figure out how to write out the netscape/delicious format file.
Examples are default url, recent vs popular, maybe even search.
Other things will come up with the readability import features and such.
It's not been working on the rick.bmark.us site. It goes in as error code 900, unparseable. Need to track it down and correct.
This is a url bookmarked in our massive.xml test file. It fails since it's not a full domain name, but might be ligit for an internal domain, something hacked into /etc/hosts. So we need to skip parsing this vs the exception currently.
FF uses a preferences object, chrome uses local storage. Want to create our own get/set object to be able to keep a constant API and -chrome and -firefox can provide the hooks to store/retrieve.
See: http://grossmeier.net/files/screenshots/bookie-footer-header.png
The lack of padding on the right made it hard to read when the browswer window was maximized.
This is in Fx4.0
I bookmarked: http://pythonmentors.com/
When I revisit the site, it won't pull up the content. Says it's not found. So something isn't nice between the url stored and the one retrieved in a check.
Tried using bookie with postgresql, but unfortunately the migrations create a virtual table for fulltext searching, which doesn't have an equivalent in postgresql.
http://twitter.com/#!/wafuqua would only bring up the main twitter page. It needs to follow the rewriting rules that the google proposal sets out when it parses/reformats the url.
Eventually we should ditch ids and use a hash (much like a shorturl) as a pk for urls. Then use that as a fk in other tables.
For instance, when we start to add support for a readability view of the page and index that, we should map it via the url hash since it'll be nice and repeatable as well as unique.
Need to run through the various methods of hosting an install
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.