GithubHelp home page GithubHelp logo

joindin / joindin-api Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 169.0 6.82 MB

The Joind.in API PHP Application

Home Page: http://docs.joind.in/joindin-api/

License: BSD 3-Clause "New" or "Revised" License

Shell 0.47% PHP 91.69% JavaScript 7.83%
hacktoberfest

joindin-api's People

Contributors

akrabat avatar arjank avatar cordoval avatar cvuorinen avatar danielcraigie avatar davidribeiro avatar dependabot-preview[bot] avatar dstockto avatar ericpoe avatar exussum12 avatar geeh avatar heiglandreas avatar iansltx avatar jean85 avatar jonnixs avatar kennyray avatar liam-wiltshire avatar localheinz avatar lornajane avatar magicmonkey avatar mattparker avatar mcneely avatar michaelcullum avatar mrailton avatar paulinevos avatar ramondelafuente avatar richsage avatar runz0rd avatar svpernova09 avatar zghosts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joindin-api's Issues

JOINDIN-466: Suppress error-messages when calling a non-existent controller

Jira issue originally created by user heiglandreas:

When calling the API with an unknown controller the complete error-report is output to the browser. That should not be the case

Reproduce: Point your browser to 'http://api.joind.in/v2.1/foo'
Expected Result: 404 message
Result:

Warning: include(/var/www/api.joind.in/51/src/inc/../controllers/FooController.php): failed to open stream: No such file or directory in /var/www/api.joind.in/51/src/inc/Autoloader.php on line 33

Warning: include(): Failed opening '/var/www/api.joind.in/51/src/inc/../controllers/FooController.php' for inclusion (include_path='.:/usr/local/php/php5.5.12/lib/php') in /var/www/api.joind.in/51/src/inc/Autoloader.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /var/www/api.joind.in/51/src/inc/Autoloader.php:33) in /var/www/api.joind.in/51/src/public/index.php on line 10

Warning: Cannot modify header information - headers already sent by (output started at /var/www/api.joind.in/51/src/inc/Autoloader.php:33) in /var/www/api.joind.in/51/src/views/HtmlView.php on line 25
0: Unknown controller foo

JOINDIN-475: Use Forwarded and X-Forwarded-For headers in Akismet check

Jira issue originally created by user akrabat:

For the Akismet check, we need to supply IP address and user agent. Code is here.

We should update this code to check for the X-Forwarded-For and Forwarded headers.

The Forwarded is defined in RFC 7239 and allows for passing originating IP address and host information through a proxy and also allows for extension tokens for other information.

We need to check Forwarded for the 'for' and 'user-agent' tokens, so that a header like this:

Forwarded: for=192.168.0.1;user-agent="Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36"

would provide an IP address and user agent for sending on to Akismet.

JOINDIN-423: Frisby tests don't check for a non-JSON response

Jira issue originally created by user richsage:

Example Frisby code:

frisby.create('Talks at ' <ins> evt.name)
    .get(evt.talks_uri </ins> '?resultsperpage=3')
    .expectStatus(200)
    .expectHeader("content-type", "application/json; charset=utf8")
    .afterJSON(function(evTalks) {
        if(typeof evTalks.talks == 'object') {
            for(var i in evTalks.talks) {
                var talk = evTalks.talks[i];
                checkTalk(talk);
            }
         }
    })

If in the above example on line 5, evTalks returns false due to non-valid JSON being returned, the tests don't fail...and perhaps they should?

JOINDIN-455: POSTing an Event should mention to its URI

Jira issue originally created by user mvriel:

When posting an event the Location header should return the URI of the newly created event but now it returns the URI of the event collection.

The documentation at http://joindin.github.io/joindin-api/events.html also shows this in the example response and my own tests confirm it:

HTTP/1.1 201 Created
Date: Wed, 18 Jun 2014 13:26:11 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Location: http://api.dev.joind.in:8080/v2.1/events
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8

JOINDIN-393: Create RSS Feed of CfP information

Jira issue originally created by user lornajane:

From phpcodemonkey:
I'd love an RSS feed of the current open CfP submissions? RSS? Yes, I know it's not all REST/Hispter but it's still very useful! :)

Actually there are a few API endpoints that would really benefit from this. In particular the comment collections I think would be good. The API uses output handlers for all requests so one approach might be to add an RSS output handler so the whole API is available this way.

JOINDIN-268: Revisit Talk Claims

Jira issue originally created by user lornajane:

This issue started life as being about the fact that we don't notify when talk claims are made.

Please read the comment thread for a more detailed description of how to make joind.in much, much better :)

JOINDIN-354: Show API token name as comment source where appropriate

Jira issue originally created by user richsage:

If a comment is posted via the API, it would be nice to show the details of the token used when requesting the comment's "source" property. For example, "joind.in Android app" or similar, rather than just "api-v2".

For reference, this field is available via the comment's verbose URI.

JOINDIN-415: user_uri error when getting a new token for an already-logged-in request

Jira issue originally created by user kevin:

This ones a bit complex; if a user is already logged-in to the web2 site, but then tries to login again (which I was only able to do because I'd introduced a bug into my web2 site) then the API call to /token contains an "Authorization" header, which causes the API code to call "getIdentity" before it follows its normal code path, which causes the "user_uri" field in the API response to be (erroneously) missing the API version from the URL.

The problem is in Request::getOauthModel (line 315 of src/inc/Request.php). The first time it's called, it memoizes $this->oauthModel. The second time it is called, it returns an OAuthModel which does not have the "version" field set, so the URL is not created properly.

I think it's something to do with $this (line 321) not surviving across the memoization properly.

JOINDIN-419: Add 'event_talks_count' and 'event_tracks_count' values to response?

Jira issue originally created by user tocacar:

In the android app, when you click to view an event, buttons are displayed to provide access to talks, comments and tracks.

At the moment, the number of comments is displayed on the button, courtesy of the 'eventcommentscount' value returned by the API.

It would be nice to show the number of talks and tracks on their respective buttons also. Would it be ok to add these values to the EventMapper::getDefaultFields() array? The $sql variable in EventMapper::getEvents() would also have to be edited to include the count of each related collection.

JOINDIN-324: Seed DB Fails

Jira issue originally created by user gargoyle:

patch39.sql added a duration field without a default value (which makes sense). However, seed.sql now fails to run properly.

JOINDIN-280: Slightly misleading "comments" number for event

Jira issue originally created by user clair:

When getting details on the event (for example, on the frontpage) the number of comments is for the event rather than talks - which at first might be a little misleading (especially if the event only has one talk)

Would it be possible to maybe have two figures? Although, I could see how this might be a bit heavy load for the server

JOINDIN-440: Not all events have stubs

Jira issue originally created by user rickogden:

When you list retrieve events from the API, there are many events which don't have a stub. Since the numerical ID of the event is not returned in the API, the stub is the easiest event identifier to use.

JOINDIN-462: Add forgot password support to web2

Jira issue originally created by user lornajane:

Currently we don't have any forgotten password functionality on the web2 site. We need the frontend on the web2 site but first the API needs to support this. Allow POSTing to an endpoint (maybe /user/resets) to request a password reset be emailed - this needs to point to a URL on web2 that can support checking the unique link that the API sent and store the new password when supplied.

Feel free to pick up just the API part to begin with.

JOINDIN-368: Proposal: Refactor Responsive Site API calls to a Guzzle client

Jira issue originally created by user s_e:

After the Guzzle talk at PHPNW13 and a quick chat with [akrabat], [lornajane] and [~clair] I thought this would be an ideal modular way of calling the API for the responsive site, with a long-term view to having a simple Joind.in API client that could be used in any php-based site wishing to make use of Joind.in data.

I'm happy to be the one to (start) implement(ing) this.

Let me know if you have any comments or suggestions, like or dislike the idea?

JOINDIN-417: XMapper::getVerboseFields() - call getDefaultFields and merge arrays?

Jira issue originally created by user tocacar:

As I was examining the code, I wondered why the Mapper classes' getVerboseFields method doesn't call getDefaultFields and then merge that array with the additional fields.

I realise that, the way things are now, some of the additional fields added in getVerboseFields are mixed in amongst (thereby affecting the order of) the values in the default fields array. I'm not sure whether this is essential or not though.

Merging the arrays in getVerboseFields would remove the need to maintain duplicate values in each method. It may also be nicer for consumers to get the fields in the same order whether requesting default or verbose (just with verbose's additional fields added at the end). I'm not sure whether or not this does make any practical difference to consumers though.

This is just an observation.

JOINDIN-362: POSTing attending doesn't check for the event/user ID row existing already

Jira issue originally created by user BarryCarlyon:

As per notes in JOINDIN-361.

When POST-ing to http://api.joind.in/v2.1/events/[eid]/attending/

The API doesn't check to see if the user/event reference already exists. It just adds a reference to the user_attend and 201 CREATED.

I'm not sure if the best solution is to chuck a unique index on the table for the two columns, or to run a query and check during the postAction to the eventMapper model, or implement both.

JOINDIN-408: Phing needs to exit if something fails

Jira issue originally created by user lornajane:

If something in the build process fails, the entire build needs to be marked as failed so that we know something went wrong. For example for an exec tag, add the checkReturn="true" parameter. Probably also applies to lint checks.

JOINDIN-418: ApiView::addCount(), no need to loop if $content['meta']['next_page'] is set

Jira issue originally created by user tocacar:

This is just another observation as I look at the code.

If the $content variable passed to ApiView::addCount has a next_page link in it, I think you may be able to skip the counting loop and instead return the value of 'resultsperpage' from the pagination link url.

This might be overly complex for not much gain, but I thought I'd mention it as the thought did occur to me.

JOINDIN-397: Fix pagination if there's 10 results on the page

Jira issue originally created by user clair:

At the moment, if there's exactly 10/20/30 etc results returned, then the "next" button will appear, with the next page showing no results (as there isn't an 11th result)

This non-urgently needs to be fixed, potentially by getting 11 results instead (knowing if there are more) and then only showing the first 10

JOINDIN-305: patch-db fails and empty the database

Jira issue originally created by user erichogue:

When creating the VM, patch-db seems to work fine. But the second time it runs, it fails and leave the db empty.

Here's the output I get when booting the VM a second time:
err: /Stage[main]/Joindin::App/Exec[patch-db]/returns: change from notrun to 0 failed: /vagrant/joindin-api/scripts/patchdb.sh -t /vagrant/joindin-api -d joindin -u joindin -p password -i returned 1 instead of one of [0] at /tmp/vagrant-puppet/modules-0/joindin/manifests/app.pp:8

notice: /Stage[main]/Joindin::App/Exec[seed-data]: Dependency Exec[patch-db] has failures: true

warning: /Stage[main]/Joindin::App/Exec[seed-data]: Skipping because of failed dependencies

JOINDIN-355: Filter events by attendance status

Jira issue originally created by user richsage:

It would be nice to be able to request events (upcoming, hot, past) that you are marked as attending. This doesn't seem possible presently, and particularly for "Past" events, it would be good to not have to retrieve all events to find eg the 2 you attended.

JOINDIN-405: web2 fails to get data with 'uri_friendly_data'

Jira issue originally created by user clair:

It looks like web2 needs data from the API with the 'urifriendlyname' field, as when connecting to a test API from vagrant I get the following Slim error:

Undefined property: stdClass::$urlfriendlyname

JOINDIN-279: Allow both VMs to communicate

Jira issue originally created by user erichogue:

The new VM for the responsive site does not see the the VM used for the original site and the API. They need to be on the same network so the responsive site can use the API on the dev environment, not the live one.

JOINDIN-392: Allow conferences to require registration for comments

Jira issue originally created by user dshafik:

It would be nice if conference organizers had the option to require registration for all comments on talks at their conference.

You could further expand this to allow users to require registration for each talk, or all of their talks, but I think it would be best if this were consistent per conference.

If nothing else, it would be interesting to see how many enable this feature, and how it affects comments.

JOINDIN-143: Additional types of links for talk related downloads

Jira issue originally created by user auroraeosrose:

Often talks have items in addition to slides - maybe a zip file of code examples or a podcast or a video or something - the ability to add additional links to the talk with this information would be great.

Stories…

  1. As a Speaker I want to be able to submit a collection of talk links to the API so that they are added to my talk
  2. As a System Admin I would like the 'slides*link' posted to the talks endpoint in the 'links' collection to be also stored to the talks table slides*links field in order to support backwards compatibility with Web1
  3. As a System Admin I would like the GET /talks endpoint to check that the talks table slide*links match the link in the talk_links table entry for the talk's slides, and update the talk*links table if not, in order that slide links updated via Web1 are replicated to the API responses
  4. What should happen if the API talks endpoint receives a request with both slides_link and an entry in the links collection of type slides?

JOINDIN-464: Fetch hash of user email with each comment

Jira issue originally created by user lornajane:

The gravatar images rely on having a hash of the user's email address, however we don't publish user email addresses via the API. Please add a field for both talk comments and event comments, in verbose mode only, which returns md5(strtolower($email)).

This same hash should be added to the verbose representation of the user resource itself.

JOINDIN-465: Fatal error on API

Jira issue originally created by user akrabat:

curl -X GET "https://api.joind.in/v2.1/users/1?verbose=yes"  -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer 6be487d170bdc53c" -m 30 -v

Results in:

* Adding handle: conn: 0x7fd18a004000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fd18a004000) send*pipe: 1, recv*pipe: 0
* About to connect() to api.joind.in port 443 (#0)
*   Trying 178.208.42.30...
* Connected to api.joind.in (178.208.42.30) port 443 (#0)
* TLS 1.0 connection using TLS*RSA_WITH_AES_128_CBC*SHA
* Server certificate: api.joind.in
* Server certificate: RapidSSL CA
* Server certificate: GeoTrust Global CA
> GET /v2.1/users/1?verbose=yes HTTP/1.1
> User-Agent: curl/7.30.0
> Host: api.joind.in
> Content-Type: application/json
> Accept: application/json
> Authorization: Bearer 6be487d170bdc53c
> 
< HTTP/1.1 400 Bad Request
< Date: Wed, 25 Jun 2014 12:28:36 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Powered-By: PHP/5.5.12
< Status: 400
< Vary: Accept-Encoding
< Content-Length: 159
< Connection: close
< Content-Type: text/html
< 
<br />
<b>Fatal error</b>:  Call to a member function render() on a non-object in <b>/var/www/api.joind.in/51/src/public/index.php</b> on line <b>11</b><br />
* Closing connection 0

JOINDIN-448: Search by date

Jira issue originally created by user clair:

I'd really like to create a kind of "calendar view" for events for the new site (I think this would be easier to use than just a list of events in date order)

Would it be possible (is it possible already?) to perform an API search by date (my use case is to be able to search by month, so for my wishes that's all I need!)

JOINDIN-413: json_encode can throw a "double INF" warning occasionally

Jira issue originally created by user richsage:

When API data is json*encode'd for subsequent output, we force conversion of strings containing numbers to actual integers, via the JSON_NUMERIC*CHECK flag. This can cause problems if the string is not meant to be parsed as such, resulting in the following error:

Warning: json_encode(): double INF does not conform to the JSON spec, encoded as 0 in php shell code on line 1

I noticed this when a test event had a stub of "4e996", which resulted in the field value being set to 0 and the above error being thrown.

JOINDIN-457: Providing a Call For Papers Start or End date results in fatal error

Jira issue originally created by user mvriel:

When I try to submit an event using the /v2.1/events endpoint and provide the cfpstart_date and cfp_enddate I receive the following output from the API:

Catchable fatal error: Object of class DateTime could not be converted to string in /vagrant/joindin-api/src/models/EventMapper.php on line 656 Call Stack: 0.0145 683904 1. {main}() /vagrant/joindin-api/src/public/index.php:0 0.2205 1095472 2. routeV2() /vagrant/joindin-api/src/public/index.php:73 0.2449 1304360 3. EventsController->handle() /vagrant/joindin-api/src/public/index.php:116 0.2452 1304360 4. EventsController->postAction() /vagrant/joindin-api/src/controllers/EventsController.php:9 0.3210 1635672 5. EventMapper->createEvent() /vagrant/joindin-api/src/controllers/EventsController.php:287 0.3210 1637568 6. PDOStatement->execute() /vagrant/joindin-api/src/models/EventMapper.php:656

The values used for both start and end date was 2014-12-31

JOINDIN-340: Sort talks collection chronologically

Jira issue originally created by user lornajane:

The list of talks at an event doesn't seem to be sorted by anything in particular. Should show the sessions in order of start time, so they make sense (and a good agenda view)

JOINDIN-346: GET by slug

Jira issue originally created by user clair:

There's a slug field that the API returns, but for the web2 site we'd like a way to search by this so we can implement slugs in the URL

JOINDIN-278: Return 'created' field in API results

Jira issue originally created by user clair:

It would be handy if the created date for an event was returned by the API, so that the responsive site can append -1, -2, and so forth to later events that may share the same name

JOINDIN-8: Put Imported Talks in Holding Area Until Confirmed

Jira issue originally created by user lornajane:

When talks are imported, they are written into the database as each line is read from the file. If there are any errors, it dies - and so can leave you with half-eaten talks added to your event. Put things into a temporary table and then ask the user to confirm all looks OK before they actually get stored and shown against the event.

JOINDIN-307: Event with CfP not Showing

Jira issue originally created by user lornajane:

Skoop tells me that the pfcongres event doesn't show in the CfP section on the website (event: https://joind.in/event/view/1240). I checked, and it does not show. Since it has the CfP box ticked, the dates are current, and it has a CfP URL, it should show up.

I checked the API and it does not appear there either (although there's another event in the API that isn't on the website! PHP Brazil: http://joind.in/event/view/1354).

JOINDIN-484: Warning thrown when no args passed to tokens endpoint

Jira issue originally created by user choult:

Warnings are thrown when visiting the following URL:

http://api.joind.in/v2.1/token


( ! ) Warning: Invalid argument supplied for foreach() in /var/www/api.joind.in/68/src/views/HtmlView.php on line 44
Call Stack

Time Memory Function Location

1 0.0001 225352 {main}( ) ../index.php:0
2 0.0015 301504 HtmlView->render( ) ../index.php:105
3 0.0015 301768 HtmlView->printArray( ) ../HtmlView.php:27

JOINDIN-277: Implement search by title for events and talks

Jira issue originally created by user clair:

For the responsive site, it would be nice to search for both events and talks by title, so that someone can search for a given talk or event in a searchbox

This issue is arisen by JOINDIN-345

JOINDIN-353: Comment URIs don't return any private comments at all

Jira issue originally created by user richsage:

At the moment the comments URIs return all public comments and no private ones, irrespective of whether a user is authenticated or not. Therefore no private comments can currently be retrieved via the API

This is more of a placeholder issue to discuss and decide an approach, based on authenticated users and their various types (admin, speaker and similar).

JOINDIN-416: EventMapper::getEventById() has a bit of unnecessary code

Jira issue originally created by user tocacar:

The EventMapper class's getEventById method contains an $order variable which is not used (and should never be required by this method anyway, as it is not necessary to sort a single result).

Furthermore, the call to $this->getEvents() inside getEventById passes 'null' as the 4th argument (this is where the $order variable would have been passed, if needed). It is not necessary to include null here as the getEvent method has null as a default value for its 4th parameter.

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.