Skip to content
This is an earlier php version of of the neotext backend, no longer supported
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
js
lib
.gitignore
LICENSE
README.md
download_quote_from_url.php
example.html
footer.php
header.php
index.php

README.md

Deprecated: Php version superseded by python (django) service

See neotext-django-server for latest version: https://github.com/neotext/neotext-django-server

For historical purposes, The php version is listed below:

Expands the context of a html quotation made with the "q" or "blockquote" tag, to include the text surrounding the quotation.

DEMO: http://www.openpolitics.com/quote-context/

Requires: blockquote tag, jQuery, jQuery.md5, simplehtmldom

Approach:

  • find all blockquotes
  • if the tag includes the cite attribute, compute a hash of the url and the quote text. Name it $hash.js
    • check to see if there exists a previously downloaded json cache of the quote named $hash.js
    • if the file doesn't exist, download a cache and compute a new json file, containing text that surrounds the quote
  • return json results to jQuery, which creates html divs containing the surrounding text, as well as arrows

BEFORE:

He humbled you by letting you hunger, then by feeding you with manna, with which neither you nor your ancestors were acquainted, in order to make you understand that one does not live by bread alone, but by every word that comes from the mouth of the Lord.

AFTER:

8 This entire commandment that I command you today you must diligently observe, so that you may live and increase, and go in and occupy the land that the Lord promised on oath to your ancestors. 2 Remember the long way that the Lord your God has led you these forty years in the wilderness, in order to humble you, testing you to know what was in your heart, whether or not you would keep his commandments.
He humbled you by letting you hunger, then by feeding you with manna, with which neither you nor your ancestors were acquainted, in order to make you understand that one does not live by bread alone, but by every word that comes from the mouth of the Lord.
4 The clothes on your back did not wear out and your feet did not swell these forty years. 5 Know then in your heart that as a parent disciplines a child so the Lord your God disciplines you. 6 Therefore keep the commandments of the Lord your God, by walking in his ways and by fearing him. 7 For the Lord your God is bringing you into a good land, a land with flowing streams, with springs and underground waters welling up in valleys and hills, 8 a land of wheat and barley, of vines and fig trees and pomegranates, a land of olive trees and honey, 9 a land where you may eat bread without scarcity, where you will lack nothing, a land whose stones are iron and from whose hills you may mine copper. 10 You shall eat your fill and bless the Lord your God for the good land that he has given you.
You can’t perform that action at this time.