{"id":19272273,"url":"https://github.com/sdslabs/phoenix","last_synced_at":"2025-08-16T23:39:10.368Z","repository":{"id":28883358,"uuid":"32407940","full_name":"sdslabs/phoenix","owner":"sdslabs","description":"Redis based phantomjs queue","archived":false,"fork":false,"pushed_at":"2015-04-07T09:56:04.000Z","size":15748,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-10-12T01:06:41.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blog.sdslabs.co/2015/04/announcing-phoenix/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdslabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-17T17:08:10.000Z","updated_at":"2018-09-24T08:37:59.000Z","dependencies_parsed_at":"2022-08-26T01:11:25.132Z","dependency_job_id":null,"html_url":"https://github.com/sdslabs/phoenix","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fphoenix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fphoenix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fphoenix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fphoenix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdslabs","download_url":"https://codeload.github.com/sdslabs/phoenix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223881288,"owners_count":17219262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:36:04.810Z","updated_at":"2024-11-09T20:36:05.342Z","avatar_url":"https://github.com/sdslabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phoenix [![Build Status](https://travis-ci.org/sdslabs/phoenix.svg?branch=master)](https://travis-ci.org/sdslabs/phoenix)\n\nRedis based phantomjs queue\n\n## Instructions\n\n* Install `redis` (https://github.com/antirez/redis)\n* Install npm modules(`$ npm install`)\n* Run tests (`npm test`)\n\n## Usage\n\nBy default it subscribes to a single channel specified in the config\nBefore you start using the application, assure that a redis server is running (`$ redis-server`).\nPhoenix will refuse to start if redis is down\n\n* Run app.js (`$ node app.js`)\n\nThis trigger the node application to spawn a new `phantomjs` child process and opens the website.\n\nYou can see the `config.sample.yml` for a sample configuration. \nNote that some options are incompatible with each other, for eg\nyou can't send a request body in a GET request.\n\nDo not edit default.yml unless you are working on phoenix itself.\n\n## Injection\nBy setting the `js` key in config.yml you can run code on the loaded web page before the page is\nloaded itself.\n\n## Logging\nphoenix logs every phantomjs instance. For every instance that is created, a new temporary\ndirectory is created in the logs directory. The config passed to phantomjs is stored in the `config.json`\nfile. The output from the phantomjs instance is stored in two files: `browser.log` and `page.log`.\n\n`browser.log` is the higher level log file, which records events and errors made by the browser instance.\nSuch as Injection events and final status of the page load.\n\n`page.log` holds the log from the page context. This includes any console.log statements made from the page\nand any alert/confirm/prompt calls as well.\n\n## Usage\nInstead of cloning and running the entire repo for each project, you can use the npm package\n(called `phantom-phoenix`), which has its own binary called `phoenix` which you can run.\n\nTo run `phoenix` in a directory, the following conditions must be true:\n\n- a valid `config.yml` file must exist in the directory\n\nAfter that you can append messages to the list specified in the config, and phoenix will\nstart runners for each of your requests once you publish the id\n\nYou can append two things to the list:\n\n- A complete valid http/https url. This replaces the url provided in the config\n- A partial querystring (such as `a=1\u0026b=2`). This overrides and merges with existing query params in the config\n\nThis way, you can send an `id=1` and phoenix will open the correct url.\n\n## Redis\n\nInstead of just using a redis pubsub, we use a hybrid pubsub+list model as queue to store logs. Instead\nof directly publishing the request to the channel, you push it to a list, and then publish the index\nof the just pushed item on the list. The list is maintained at `$channel:queue`, where $channel is the queue\nname specified in the config.\n\nFor, eg if the channel name is the default (`phoenix`), you do the following:\n\n- run `phoenix`\n- `redis-cli`\n\n```\nRPUSH phoenix:queue \"http://google.com\"`\n(integer) 8\nPUBLISH phoenix 7\n```\n\nphoenix will pick this up and give something like following as output:\n\n```\nSTART: phoenix-11634lNeXLbHqhRM3\nSTOP : phoenix-11634lNeXLbHqhRM3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdslabs%2Fphoenix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdslabs%2Fphoenix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdslabs%2Fphoenix/lists"}