Giter VIP home page Giter VIP logo

hackful's Introduction

About

Hackful is a platform developed to power http://hackful.com, a place for European entrepreneurs to share demos, stories or ask questions.

Developed by @8bitpal

Idea by @rayhanrafiq and @mattslight

Hosting donated by incite ict

Setup

Hackful runs on mysql.

Quick fix for getting the configuration to work in OSX as well as in ubuntu sudo ln -s /tmp/mysql.sock /var/run/mysqld/mysqld.sock

API

Quick Facts

  • Format for API is JSON
  • You can Login with your credential or with a authentication token
  • Frontpage, Ask and New resources are avalaible as JSON
  • Posts JSON includes voting status, e.g. did you already vote the entry or not
  • Submiting, commenting and upvoting can be easily done with API
  • You can signup via API
  • Notfications are avalaible as JSON if you are logged in

Discussion on hackful.com

Known issues:

  • Login is not encrypted and this should be fixed

Examples for API:

Request all posts on frontpage:
GET http://hackful.com/api/v1/posts/frontpage
Response:
[{
	"created_at":"2012-03-24T10:11:14Z",
	"down_votes":0,
	"id":49,
	"link":"http://www.balkanventureforum.org/",
	"text":"Balkan Venture Forum April 2012",
	"title":"Balkan Venture Forum April 2012",
	"up_votes":4,
	"updated_at":"2012-03-26T18:48:19Z",
	"comment_count":6,
	"path":"/posts/49",
	"voted":false,
	"user":{
		"id":1,
		"name":"Oemera"
	}
}, ...]
Request all comments for a post:
GET http://hackful.com/api/v1/posts/frontpage
Response:
[{
	"commentable_id":49,
	"created_at":"2012-03-24T10:12:21Z",
	"id":34,
	"text":"asdasdasd",
	"up_votes":1,
	"updated_at":"2012-03-24T10:12:21Z",
	"voted":false,
	"user":{
		"id":9,
		"name":"AwesomeGuy"
	},
	"children":[
		{
			"commentable_id":34,
			"created_at":"2012-03-24T10:12:26Z",
			"id":35,
			"text":"asdasdasd",
			"up_votes":1,
			"updated_at":"2012-03-24T10:12:26Z",
			"voted":false,
			"user":{
				"id":9,
				"name":"AwesomeGuy"
			},
			"children":[]
		}, ... ]
}, ...]
Login and recieve a auth_token:
POST http://hackful.com/api/v1/sessions/login
user[email][email protected]&user[password]=mypassword
Response:
{
	"success":true,
	"message":"Successfully logged in",
	"auth_token":"xHpdsVa5QqahMRxqc4zc",
	"user":{
		"id":8,
		"name":"RandomGuy",
		"email":"[email protected]"
	}
}
Upvote a post
PUT http://hackful.com/api/v1/post/1/upvote
auth_token=1ZwyJfbv7eiiLE7Gipsv
Submit a new article:
POST http://hackful.com/api/v1/post
auth_token=1ZwyJfbv7eiiLE7Gipsv&post[text]=Text&post[title]=Title&post[link]=http://example.com

All implemented API methods:

POST 	/api/v1/signup

GET 	/api/v1/user/:id
GET 	/api/v1/user/notifications
PUT 	/api/v1/user

GET 	/api/v1/posts/frontpage(/:page)
GET 	/api/v1/posts/new(/:page)
GET 	/api/v1/posts/ask(/:page)
GET 	/api/v1/posts/user/:id(/:page)

GET 	/api/v1/post/:id
POST 	/api/v1/post
PUT 	/api/v1/post/:id
DELETE 	/api/v1/post/:id
PUT 	/api/v1/post/:id/upvote
PUT 	/api/v1/post/:id/downvote

GET 	/api/v1/comments/user/:id
GET 	/api/v1/comments/post/:id
GET 	/api/v1/comment/:id
POST 	/api/v1/comment
PUT 	/api/v1/comment/:id
DELETE 	/api/v1/comment/:id
PUT 	/api/v1/comment/:id/upvote
PUT 	/api/v1/comment/:id/downvote

Contribution

Please post feature requests or bugs as issues.

Testing

Cucumber test cases are almost done and on the way.

ToDo's

  • Write wiki article for hackful API
  • Encrypt API login (password is send without encryption to API)

hackful's People

Contributors

oemera avatar pbjorklund avatar dsthode avatar dbasch avatar anze3db avatar

Stargazers

Gautam Kolan avatar

Watchers

Gautam Kolan 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.